Remove old keyboard shortcut and add the new one

This commit is contained in:
Mylloon 2021-12-23 22:36:12 +01:00
parent 7680509234
commit 1b4dc09bbf
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -6,4 +6,28 @@ echo -e "\nFlameshot installed!"
# Apply custom configuration
rm $HOME/.config/flameshot/flameshot.ini 2>/dev/null
wget https://git.kennel.ml/Anri/myLinuxConfiguration/raw/branch/main/.config/flameshot/flameshot.ini -P $HOME/.config/flameshot/
# Remove old shortcut assign with the Print key
gsettings set org.gnome.settings-daemon.plugins.media-keys screenshot "[]"
echo -e "\nOld ImprEcran shortcut removed!"
# Fetching customs keyboard shortcuts
CUSTOM_KEYBINDINGS_LIST=$(gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings)
if [[ $CUSTOM_KEYBINDINGS_LIST == "@as []" ]] # Creating new list if not exists
then
CUSTOM_KEYBINDINGS_LIST="['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/flameshot-shortcut/']"
else # If already existing, adding our new element
CUSTOM_KEYBINDINGS_LIST="${CUSTOM_KEYBINDINGS_LIST::-1}, '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/flameshot-shortcut/']"
fi
# Updating the list
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "$CUSTOM_KEYBINDINGS_LIST"
# Configure the new shortcut
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/flameshot-shortcut/ name 'Flameshot' # set name
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/flameshot-shortcut/ command 'flameshot gui' # set command
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/flameshot-shortcut/ binding 'Print' # set key
echo -e "\nFlameshot shortcut added (ImprEcran key)!"
echo -e "\nFlameshot configured! 🎉"