2021-11-14 00:44:24 +01:00
# Fetching last versin of x11-emoji-picker
2021-11-10 21:26:49 +01:00
wget -q https://api.github.com/repos/GaZaTu/x11-emoji-picker/releases/latest
echo "Retrieve the last package..."
grep 'browser_download_url": ".*.deb"' latest | awk '{ print substr ($0, 32 ) }' | awk '{ print substr( $0, 1, length($0)-1 ) }' > url
rm latest
2021-11-14 00:44:24 +01:00
# Downloading package
2021-11-10 21:26:49 +01:00
wget -q --show-progress -i url -O x11-emoji-picker.deb
rm url
2021-11-14 00:44:24 +01:00
# Installing dependencies
2021-11-10 21:26:49 +01:00
wget -q --show-progress http://ftp.br.debian.org/debian/pool/main/i/icu/libicu57_57.1-6+deb9u4_amd64.deb
sudo apt install ./libicu57_57.1-6+deb9u4_amd64.deb -y
rm libicu57_57.1-6+deb9u4_amd64.deb
2021-11-14 00:44:24 +01:00
# Installing the emoji picker
2021-11-10 21:26:49 +01:00
sudo apt install ./x11-emoji-picker.deb -y
2021-11-14 00:44:24 +01:00
# Deleting the .deb
2021-11-10 21:26:49 +01:00
rm x11-emoji-picker.deb
2021-11-11 22:41:04 +01:00
2021-11-14 00:44:24 +01:00
# Adding the keyboard shortcut
# Fetching customs keyboard shortcuts
2021-11-12 14:58:46 +01:00
CUSTOM_KEYBINDINGS_LIST = $( gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings)
2021-11-14 00:44:24 +01:00
if [ [ $CUSTOM_KEYBINDINGS_LIST = = "@as []" ] ] # Creating new list if not exists
2021-11-12 14:58:46 +01:00
then
CUSTOM_KEYBINDINGS_LIST = "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/x11-emoji-picker/']"
2021-11-14 00:44:24 +01:00
else # If already existing, adding our new element
2021-11-12 14:58:46 +01:00
CUSTOM_KEYBINDINGS_LIST = " ${ CUSTOM_KEYBINDINGS_LIST : :- 1 } , '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/x11-emoji-picker/'] "
fi
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings " $CUSTOM_KEYBINDINGS_LIST " # On met à jour la liste
2021-11-14 00:44:24 +01:00
# Naming it
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' # Set name
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' # Set command
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/x11-emoji-picker/ binding '<Super>semicolon' # Set shortcut
2021-11-12 17:30:27 +01:00
echo ""
echo "Emoji picker installed"
echo "Select \"InputMethod: activate window & default\""