From 3fd4456614c81e0bd7794d4aa828ce132643a10d Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 12 Nov 2021 14:58:46 +0100 Subject: [PATCH] Fix erasing old custom keyboard shortcuts --- installEmojiPicker.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/installEmojiPicker.sh b/installEmojiPicker.sh index 797bc05..917b9f6 100644 --- a/installEmojiPicker.sh +++ b/installEmojiPicker.sh @@ -16,8 +16,18 @@ sudo apt install ./x11-emoji-picker.deb -y rm x11-emoji-picker.deb # On ajoute un raccourci clavier -gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/x11-emoji-picker/']" +# On récupère la liste des raccourcis personnalisés +CUSTOM_KEYBINDINGS_LIST=$(gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings) +if [[ $CUSTOM_KEYBINDINGS_LIST == "@as []" ]] # Si il y en a pas on créer construit notre liste +then + CUSTOM_KEYBINDINGS_LIST="['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/x11-emoji-picker/']" + echo $CUSTOM_KEYBINDINGS_LIST +else # Si il y en a déjà on rajoute un élément à la liste + CUSTOM_KEYBINDINGS_LIST="${CUSTOM_KEYBINDINGS_LIST::-1}, '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/x11-emoji-picker/']" + echo $CUSTOM_KEYBINDINGS_LIST +fi +gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "$CUSTOM_KEYBINDINGS_LIST" # On met à jour la liste # On le nomme -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/x11-emoji-picker/ name "'Emoji Picker'" -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/x11-emoji-picker/ binding "'semicolon'" -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/x11-emoji-picker/ command "'emoji-picker'" +gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/x11-emoji-picker/ name 'Emoji Picker' # On définit le nom de l'élément qu'on a rajouté +gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/x11-emoji-picker/ command 'emoji-picker' # On définit la commande de l'élément qu'on a rajouté +gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/x11-emoji-picker/ binding 'semicolon' # On définit le raccourci de l'élément qu'on a rajouté