workstation/roles/home-gui/files/gnome-setup.sh

137 lines
6.3 KiB
Bash
Raw Normal View History

2021-02-24 17:12:09 +00:00
#!/bin/bash
test -x /usr/bin/gsettings || (echo "gsettings not found" && exit 1)
set_favorites_bar () {
local firefox
if [ -r /usr/share/applications/firefox-esr.desktop ] && [ ! -r /usr/share/applications/firefox.desktop ]
then
firefox=firefox-esr
else
firefox=firefox
fi
if [ -r ${XDG_CONFIG_HOME:-$HOME/.config}/favorite-apps.conf ]; then
gsettings set org.gnome.shell favorite-apps "$(cat ${XDG_CONFIG_HOME:-$HOME/.config}/favorite-apps.conf)"
else
gsettings set org.gnome.shell favorite-apps "['org.gnome.Terminal.desktop', 'org.gnome.Nautilus.desktop', '$firefox.desktop']"
fi
2021-02-24 17:12:09 +00:00
}
set_favorites_bar
set_keyboard_and_language () {
2021-11-24 11:38:18 +00:00
gsettings set org.gnome.desktop.input-sources show-all-sources true
2021-11-24 12:54:58 +00:00
gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us'), ('xkb', 'gb')]"
2021-05-11 11:09:55 +00:00
gsettings set org.gnome.desktop.input-sources xkb-options "['lv3:ralt_switch', 'compose:caps', 'shift:both_capslock']"
2021-11-11 11:25:57 +00:00
gsettings set org.gnome.desktop.wm.keybindings switch-applications "['<Super>Tab']"
gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward "['<Shift><Super>Tab']"
gsettings set org.gnome.desktop.wm.keybindings switch-windows-backward "['<Shift><Alt>Tab']"
gsettings set org.gnome.desktop.wm.keybindings switch-windows "['<Alt>Tab']"
2021-11-14 13:52:48 +00:00
# Set custom keybindings.
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/launch-terminal/']"
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/launch-terminal/ command '/usr/bin/gnome-terminal'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/launch-terminal/ name 'Launch Terminal'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/launch-terminal/ binding '<Primary><Alt>t'
2021-02-24 17:12:09 +00:00
}
set_keyboard_and_language
set_nautilus_preferences () {
gsettings set org.gnome.nautilus.preferences default-folder-viewer 'list-view'
2021-02-25 19:06:23 +00:00
gsettings set org.gtk.Settings.FileChooser sort-directories-first true
2021-02-24 17:12:09 +00:00
}
set_nautilus_preferences
2021-02-25 19:06:23 +00:00
set_gnome_terminal_preferences () {
gsettings set org.gnome.Terminal.Legacy.Settings menu-accelerator-enabled false
gsettings set org.gnome.Terminal.Legacy.Settings shortcuts-enabled false
}
set_gnome_terminal_preferences
set_gnome_extensions () {
gnomeextcmd=/usr/bin/gnome-extensions
if ! [ -x $gnomeextcmd ]
then
# gnome-extensions not installed.
return
fi
2021-11-23 08:59:55 +00:00
# Bash-specific test.
2021-11-24 15:42:19 +00:00
if [[ "$(. /etc/os-release && echo ${ID:-none})" == rhel ]] || [[ "$(. /etc/os-release && echo ${ID_LIKE:-none})" == *rhel* ]]
then
dashtodock=dash-to-dock@gnome-shell-extensions.gcampax.github.com
else
dashtodock=dash-to-dock@micxgx.gmail.com
fi
for ext in $dashtodock appindicatorsupport@rgcjonas.gmail.com
do
2021-11-27 20:52:16 +00:00
$gnomeextcmd disable -q $ext
done
}
set_gnome_extensions
2021-11-10 13:10:50 +00:00
set_dash_to_dock_preferences () {
if gsettings list-keys org.gnome.shell.extensions.dash-to-dock 2>&1 >/dev/null; then
# Reset all dash-to-dock settings.
gsettings reset-recursively org.gnome.shell.extensions.dash-to-dock
# Set my preferences, based on Ubuntu's default config (as of 21.10).
2021-11-14 13:59:18 +00:00
gsettings set org.gnome.shell.extensions.dash-to-dock background-color '#000000'
gsettings set org.gnome.shell.extensions.dash-to-dock background-opacity 1.0
2021-11-10 13:10:50 +00:00
gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'focus-or-previews'
2021-11-14 13:59:18 +00:00
gsettings set org.gnome.shell.extensions.dash-to-dock custom-background-color true
2021-11-10 13:10:50 +00:00
gsettings set org.gnome.shell.extensions.dash-to-dock custom-theme-customize-running-dots true
gsettings set org.gnome.shell.extensions.dash-to-dock custom-theme-running-dots-border-color '#ffffff'
gsettings set org.gnome.shell.extensions.dash-to-dock custom-theme-running-dots-color '#ffffff'
2021-11-10 13:10:50 +00:00
gsettings set org.gnome.shell.extensions.dash-to-dock custom-theme-shrink true
gsettings set org.gnome.shell.extensions.dash-to-dock dock-fixed true
gsettings set org.gnome.shell.extensions.dash-to-dock dock-position 'LEFT'
2021-11-10 13:10:50 +00:00
gsettings set org.gnome.shell.extensions.dash-to-dock extend-height true
gsettings set org.gnome.shell.extensions.dash-to-dock icon-size-fixed true
gsettings set org.gnome.shell.extensions.dash-to-dock intellihide-mode 'ALL_WINDOWS'
2021-11-11 08:33:13 +00:00
gsettings set org.gnome.shell.extensions.dash-to-dock multi-monitor true
2021-11-10 13:10:50 +00:00
gsettings set org.gnome.shell.extensions.dash-to-dock running-indicator-style 'DOTS'
gsettings set org.gnome.shell.extensions.dash-to-dock scroll-action 'switch-workspace'
gsettings set org.gnome.shell.extensions.dash-to-dock shift-click-action 'launch'
gsettings set org.gnome.shell.extensions.dash-to-dock shift-middle-click-action 'minimize'
gsettings set org.gnome.shell.extensions.dash-to-dock show-mounts false
gsettings set org.gnome.shell.extensions.dash-to-dock show-trash false
gsettings set org.gnome.shell.extensions.dash-to-dock transparency-mode 'FIXED'
fi
}
set_dash_to_dock_preferences
2021-02-25 19:06:23 +00:00
set_misc_preferences () {
# Disable alert sounds.
gsettings set org.gnome.desktop.sound event-sounds false
2021-09-24 10:46:49 +00:00
# Turn on natural scrolling.
gsettings set org.gnome.desktop.peripherals.touchpad natural-scroll true
2021-03-11 11:30:46 +00:00
# Configure the top bar and calendar.
gsettings set org.gnome.desktop.interface clock-show-date true
2021-03-11 11:50:52 +00:00
gsettings set org.gnome.desktop.interface clock-show-seconds false
2021-03-11 11:30:46 +00:00
gsettings set org.gnome.desktop.interface show-battery-percentage true
gsettings set org.gnome.desktop.calendar show-weekdate true
# Add minimise and maximise buttons to the window title bars.
2021-11-27 20:52:16 +00:00
gsettings set org.gnome.desktop.wm.preferences button-layout 'appmenu:close'
2021-03-11 11:30:46 +00:00
# Stop dialogue boxes from 'sticking' to their parent windows.
gsettings set org.gnome.mutter attach-modal-dialogs false
2021-11-27 20:52:16 +00:00
# Enable hot-corners.
gsettings set org.gnome.desktop.interface enable-hot-corners true
# Set a background colour for when a wallpaper is not available.
2021-11-24 16:01:21 +00:00
gsettings set org.gnome.desktop.background primary-color '#023c88'
gsettings set org.gnome.desktop.background secondary-color '#5789ca'
gsettings set org.gnome.desktop.background color-shading-type 'solid'
2021-02-25 19:06:23 +00:00
}
set_misc_preferences
if [ -x "$HOME/bin/reset-gnome-setup.local" ]
then
. "$HOME/bin/reset-gnome-setup.local"
fi