Skip to content

Instantly share code, notes, and snippets.

@flukejones
Created April 27, 2017 02:04
Show Gist options
  • Save flukejones/b1bb345b3064df2ba23a285a3d24f648 to your computer and use it in GitHub Desktop.
Save flukejones/b1bb345b3064df2ba23a285a3d24f648 to your computer and use it in GitHub Desktop.
A shell script to change various themes in Gnome from light/dark
#!/usr/bin/env bash
changetheme() {
local theme_file="$HOME/.config/themelight"
local light_gtk="Adwaita"
local light_gedit="builder"
local light_vim="zellner"
local dark_gtk="Adwaita-dark"
local dark_gedit="builder-dark"
local dark_vim="elflord"
local conf_gedit="org.gnome.gedit.preferences.editor scheme"
local conf_builder="org.gnome.builder.editor style-scheme-name"
local conf_shell="org.gnome.shell.extensions.user-theme name"
local conf_gtk="org.gnome.desktop.interface gtk-theme"
local conf_vim="$HOME/.vimrc"
#local conf_sublime="$HOME/.config/sublime-text-3/Packages/User/Preferences.sublime-settings"
if [ -e "$theme_file" ]; then
sed -ie 's/'$light_vim'/'$dark_vim'/g' "$conf_vim"
gsettings set $conf_gedit $dark_gedit
gsettings set $conf_builder $dark_gedit
gsettings set $conf_gtk $dark_gtk
#sed -i -e 's/Boxy Solarized Light.tmTheme/Boxy Ocean.tmTheme/g' "$conf_sublime"
#sed -i -e 's/Boxy Solarized Light.sublime-theme/Boxy Ocean.sublime-theme/g' "$conf_sublime"
rm -f "$theme_file"
else
sed -ie 's/'$dark_vim'/'$light_vim'/g' "$conf_vim"
gsettings set $conf_gedit $light_gedit
gsettings set $conf_builder $light_gedit
gsettings set $conf_gtk $light_gtk
#sed -i -e 's/Boxy Ocean.tmTheme/Boxy Solarized Light.tmTheme/g' "$conf_sublime"
#sed -i -e 's/Boxy Ocean.sublime-theme/Boxy Solarized Light.sublime-theme/g' "$conf_sublime"
touch "$theme_file"
fi
}
changetheme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment