From 5235914d5b48ab38e303fdf57a7928b397df1c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Benencia?= Date: Sun, 13 Oct 2024 10:26:15 -0700 Subject: gnome: repeatable custom-keybindings --- bin/gnome-set-config | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'bin') 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 "'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 "'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 "'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 "'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'" -- cgit v1.2.3