2022-08-22 14:16:10 +00:00
#!/bin/sh
2021-02-24 17:12:09 +00:00
test -x /usr/bin/gsettings || ( echo "gsettings not found" && exit 1)
set_favorites_bar ( ) {
2022-08-22 14:16:10 +00:00
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 " ) "
2021-11-07 18:57:58 +00:00
else
2022-10-12 12:58:43 +00:00
gsettings set org.gnome.shell favorite-apps "['org.gnome.Terminal.desktop', 'org.gnome.Console.desktop', 'org.gnome.Nautilus.desktop', 'org.mozilla.firefox.desktop']"
2021-11-07 18:57:58 +00:00
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
2022-10-11 21:43:41 +00:00
gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'ca+multix'), ('xkb', 'gb')]"
2022-01-17 12:24:52 +00:00
gsettings set org.gnome.desktop.input-sources xkb-options "['lv3:ralt_switch', 'compose:caps', 'nbsp:level3n', '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 "['<Alt>Tab']"
2022-10-11 21:43:41 +00:00
gsettings set org.gnome.desktop.wm.keybindings switch-windows-backward "['<Shift><Alt>Tab']"
2021-11-14 13:52:48 +00:00
# Set custom keybindings.
2022-10-12 12:58:43 +00:00
if [ -x /usr/bin/kgx ] && ! [ -x /usr/bin/gnome-terminal ]
then
_acp_term = /usr/bin/kgx
else
_acp_term = /usr/bin/gnome-terminal
fi
2021-11-14 13:52:48 +00:00
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/launch-terminal/']"
2022-10-12 12:58:43 +00:00
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/launch-terminal/ command " $_acp_term "
2021-11-14 13:52:48 +00:00
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'
2022-10-12 12:58:43 +00:00
unset _acp_term
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
2022-04-08 18:13:53 +00:00
gsettings set org.gnome.Terminal.Legacy.Settings theme-variant 'dark'
2022-01-11 12:13:29 +00:00
defaultprofile = " org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/: $( gsettings get org.gnome.Terminal.ProfilesList default | tr -d \' ) / "
2022-08-22 14:16:10 +00:00
gsettings set " $defaultprofile " background-color '#101010'
gsettings set " $defaultprofile " default-size-columns 132
gsettings set " $defaultprofile " default-size-rows 24
gsettings set " $defaultprofile " foreground-color '#C0C0C0'
gsettings set " $defaultprofile " palette " [
2022-01-11 21:19:16 +00:00
'#000000' , '#800000' , '#008000' , '#808000' , '#000080' , '#800080' , '#008080' , '#C0C0C0' ,
'#808080' , '#FF0000' , '#00FF00' , '#FFFF00' , '#0000FF' , '#FF00FF' , '#00FFFF' , '#FFFFFF'
2022-01-11 21:00:22 +00:00
] "
2022-08-22 14:16:10 +00:00
gsettings set " $defaultprofile " use-theme-colors false
2021-02-25 19:06:23 +00:00
}
set_gnome_terminal_preferences
2021-11-21 23:11:59 +00:00
set_gnome_extensions ( ) {
gnomeextcmd = /usr/bin/gnome-extensions
if ! [ -x $gnomeextcmd ]
then
# gnome-extensions not installed.
return
fi
2021-12-21 11:37:55 +00:00
# Disable all extensions.
for ext in $gnomeextcmd list --enabled
2021-11-21 23:11:59 +00:00
do
2021-12-17 12:46:21 +00:00
$gnomeextcmd disable -q $ext
2021-11-21 23:11:59 +00:00
done
}
set_gnome_extensions
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
2022-02-13 18:05:10 +00:00
gsettings set org.gnome.desktop.calendar show-weekdate false
2021-03-11 11:30:46 +00:00
2021-12-17 12:46:21 +00:00
# Remove minimise and maximise buttons from the window title bars.
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-14 13:41:49 +00:00
2021-12-21 11:37:55 +00:00
# Disable hot-corners.
gsettings set org.gnome.desktop.interface enable-hot-corners false
2021-11-16 16:01:34 +00:00
# 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'
2021-11-16 16:01:34 +00:00
gsettings set org.gnome.desktop.background color-shading-type 'solid'
2021-12-30 15:12:17 +00:00
# Configure fonts.
2021-12-31 14:00:04 +00:00
gsettings set org.gnome.desktop.interface document-font-name 'Sans 11'
gsettings set org.gnome.desktop.interface font-name 'Sans 11'
2021-12-30 15:12:17 +00:00
gsettings set org.gnome.desktop.interface monospace-font-name 'Monospace 11'
2021-12-31 14:00:04 +00:00
gsettings set org.gnome.desktop.wm.preferences titlebar-font 'Sans Bold 11'
2021-12-31 14:50:35 +00:00
# Always show the Accessibility menu.
gsettings set org.gnome.desktop.a11y always-show-universal-access-status true
2021-02-25 19:06:23 +00:00
}
set_misc_preferences
2021-05-10 10:58:00 +00:00
2022-03-17 12:10:58 +00:00
if [ -r " ${ XDG_CONFIG_HOME :- $HOME /.config } /reset-gnome-setup.local " ]
2021-05-10 10:58:00 +00:00
then
2022-03-17 12:10:58 +00:00
. " ${ XDG_CONFIG_HOME :- $HOME /.config } /reset-gnome-setup.local "
2021-05-10 10:58:00 +00:00
fi