This repository has been archived on 2022-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
manjaroConfiguration/installFlameshot.sh

42 lines
2.1 KiB
Bash
Raw Normal View History

2021-12-23 15:11:06 +01:00
# Install flameshot
sudo apt update
sudo apt install flameshot -y
2021-12-23 15:13:02 +01:00
echo -e "\nFlameshot installed!"
2021-12-23 15:11:06 +01:00
# Apply custom configuration
rm $HOME/.config/flameshot/flameshot.ini 2>/dev/null
2021-12-23 22:41:23 +01:00
wget -q --show-progress 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 "[]"
2021-12-23 22:44:14 +01:00
echo "Old 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)!"
# We remove the Ubuntu desktop shortcut only if it already exists
if [ -f /usr/share/applications/org.flameshot.Flameshot.desktop ]
2021-12-28 16:38:15 +01:00
then
sudo mv /usr/share/applications/org.flameshot.Flameshot.desktop /usr/share/applications/org.flameshot.Flameshot.desktop.bak
echo -e "\nFlameshot icon removed!"
2021-12-28 16:38:15 +01:00
fi
2021-12-23 15:13:02 +01:00
echo -e "\nFlameshot configured! 🎉"