aboutsummaryrefslogtreecommitdiff
path: root/user-scripts
diff options
context:
space:
mode:
authorNunoSempere <nuno.semperelh@protonmail.com>2024-03-14 15:59:51 -0300
committerNunoSempere <nuno.semperelh@protonmail.com>2024-03-14 16:00:10 -0300
commit0f2ca9b9f7790a664a548bc6034711a17101519d (patch)
tree60e3e06114da492e21696d335257ee588daec2a2 /user-scripts
parenta66bcf58402d5ea550401cbeb15ecb174242fb39 (diff)
document how to add a shortcut in Debian
Diffstat (limited to 'user-scripts')
-rw-r--r--user-scripts/debian-12/install-with-dependencies.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/user-scripts/debian-12/install-with-dependencies.sh b/user-scripts/debian-12/install-with-dependencies.sh
index aa68f09..e1aa254 100644
--- a/user-scripts/debian-12/install-with-dependencies.sh
+++ b/user-scripts/debian-12/install-with-dependencies.sh
@@ -23,3 +23,18 @@ cd -
# Debian desktop icon
chmod +x rosenrot.desktop
sudo cp rosenrot.desktop /usr/share/applications
+
+# Optionally, set a shortcut (within GNOME)
+# https://askubuntu.com/questions/597395/how-to-set-custom-keyboard-shortcuts-from-terminal/1007035#1007035
+name="rose"
+binding="<CTRL><SHIFT>W"
+action="/usr/bin/rosenrot"
+
+media_keys=org.gnome.settings-daemon.plugins.media-keys
+custom_kbd=org.gnome.settings-daemon.plugins.media-keys.custom-keybinding
+kbd_path=/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/$name/
+new_bindings=`gsettings get $media_keys custom-keybindings | sed -e"s>'\]>','$kbd_path']>"| sed -e"s>@as \[\]>['$kbd_path']>"`
+gsettings set $media_keys custom-keybindings "$new_bindings"
+gsettings set $custom_kbd:$kbd_path name "$name"
+gsettings set $custom_kbd:$kbd_path binding "$binding"
+gsettings set $custom_kbd:$kbd_path command "$action"