diff options
author | Raúl Benencia <id@rbenencia.name> | 2024-10-13 10:26:15 -0700 |
---|---|---|
committer | Raúl Benencia <id@rbenencia.name> | 2024-10-13 10:26:15 -0700 |
commit | 5235914d5b48ab38e303fdf57a7928b397df1c1e (patch) | |
tree | b6c35b6cc8d30ebe32753cc7facfca8fbeb71798 /bin/gnome-set-config | |
parent | 5d899172042be1174df1f22a50d765270c229bbd (diff) |
gnome: repeatable custom-keybindings
Diffstat (limited to 'bin/gnome-set-config')
-rwxr-xr-x | bin/gnome-set-config | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/bin/gnome-set-config b/bin/gnome-set-config index b199378..1ac9fc0 100755 --- a/bin/gnome-set-config +++ b/bin/gnome-set-config @@ -15,10 +15,17 @@ for i in $(seq 1 $NUM_WORKSPACES); do done # This configuration is not present in gsettings; we need to fall back to dconf -dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/binding "'<Super>Return'" -dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/command "'kgx'" -dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/name "'Open terminal'" +bindings="emacs org-mode" +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 /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/binding "'<Shift><Super>o'" -dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/command "'emacsclient -e \"(prot-window-popup-org-capture)\"'" -dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/name "'org-capture'" +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'" |