diff options
Diffstat (limited to 'bin/gnome-set-config')
-rwxr-xr-x | bin/gnome-set-config | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/bin/gnome-set-config b/bin/gnome-set-config index 5bfb476..15771d7 100755 --- a/bin/gnome-set-config +++ b/bin/gnome-set-config @@ -1,12 +1,46 @@ #!/bin/sh +# Sets my preferred Gnome config. +# Find existing bindings with: +# for e in $(gsettings list-schemas | grep bind); do gsettings list-recursively $e; done NUM_WORKSPACES=9 gsettings set org.gnome.mutter dynamic-workspaces false gsettings set org.gnome.desktop.wm.preferences num-workspaces $NUM_WORKSPACES +# Disable the default <Super>p. I don't use it, and it's disruptive when I accidentally trigger it. +gsettings set org.gnome.mutter.keybindings switch-monitor '[]' + for i in $(seq 1 $NUM_WORKSPACES); do gsettings set org.gnome.shell.keybindings switch-to-application-$i '[]' gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-$i "['<Super>$i']" gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-$i "['<Shift><Super>$i']" done + +# This configuration is not present in gsettings; we need to fall back to dconf +bindings="emacs org-mode move-windows rofi" +keybindings_key="/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings" +keybindings=$(echo $bindings | awk -v key="$keybindings_key" '{for(i=1;i<=NF;i++) printf("'\''" key "/" $i "/'\''%s", (i==NF ? "" : ","))}') +keybindings="[$keybindings]" + +dconf write "$keybindings_key" "$keybindings" + +dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/emacs/binding "'<Shift><Super>e'" +dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/emacs/command "'emacsclient -c'" +dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/emacs/name "'Emacs'" + +dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/org-mode/binding "'<Shift><Super>o'" +dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/org-mode/command "'emacsclient -e \"(prot-window-popup-org-capture)\"'" +dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/org-mode/name "'org-capture'" + +dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/move-windows/binding "'<Shift><Super>m'" +dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/move-windows/command "'gnome-move-windows'" +dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/move-windows/name "'move-windows'" + +# Disable default for <Super>space. +gsettings set org.gnome.desktop.wm.keybindings switch-input-source "[]" +gsettings set org.gnome.desktop.wm.keybindings switch-input-source-backward '[]' + +dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/rofi/binding "'<Super>space'" +dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/rofi/command "'rofi -show window'" +dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/rofi/name "'rofi'" |