33 lines
1.8 KiB
Bash
33 lines
1.8 KiB
Bash
# Install flameshot
|
|
sudo apt update
|
|
sudo apt install flameshot -y
|
|
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! 🎉"
|