nix-community / dconf2nix

:feet: Convert dconf files (e.g. GNOME Shell) to Nix, as expected by Home Manager [maintainer=@jtojnar]
Apache License 2.0
228 stars 6 forks source link

Keyboard shortcut with quoted command gives invalid nix config #48

Closed skogsbrus closed 2 years ago

skogsbrus commented 2 years ago

Hey, first of thanks for this plugin. Really makes managing my gnome state easier :)

I encountered a bug just now where I've added a keyboard shortcut:

<Super>space --> gnome-terminal -e "vim --cmd startinsert"

This fails to apply in the nix configuration:

building the system configuration...
error: undefined variable 'vim'

       at /nix/store/n3w211g7700r9d2h58qqj2fjs5hri2xq-source/home/dconf.nix:280:38:

          279|       binding = "<Super>space";
          280|       command = "'gnome-terminal -e "vim --cmd startinsert"'";
             |                                      ^
          281|       name = "Launch scratchpad";
(use '--show-trace' to show detailed location information)

Seems like quotes aren't escaped?

skogsbrus commented 2 years ago

image

gvolpe commented 2 years ago

Hi @skogsbrus ,

Can you please paste the donf dump of the problematic key? You can run dconf dump /path/to/key to get it.

skogsbrus commented 2 years ago

Definitely,

$ dconf dump /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/
[/]
binding='<Super>space'
command='gnome-terminal -e "vim --cmd startinsert"'
name='Launch scratchpad'

Thanks for taking a look at this!