Skip to content

Instantly share code, notes, and snippets.

@Zash
Created June 10, 2023 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zash/6981fc4aa87615a87c61669176cf3382 to your computer and use it in GitHub Desktop.
Save Zash/6981fc4aa87615a87c61669176cf3382 to your computer and use it in GitHub Desktop.
Scripts for switching between dark and light theme
#!/bin/sh
THEME=Materia-dark-compact
if type xfconf-query >/dev/null ; then
xfconf-query -c xsettings -p /Net/ThemeName -s $THEME
fi
if type gsettings >/dev/null ; then
gsettings set org.gnome.desktop.interface gtk-theme $THEME
fi
if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini" ]; then
sed -i "/-theme-name/s/=.*/=$THEME/; /prefer-dark-theme/s/=.*/=true/" "${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini"
fi
#!/bin/sh
THEME=Materia-compact
if type xfconf-query >/dev/null ; then
xfconf-query -c xsettings -p /Net/ThemeName -s $THEME
fi
if type gsettings >/dev/null ; then
gsettings set org.gnome.desktop.interface gtk-theme $THEME
fi
if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini" ]; then
sed -i '/-theme-name/s/=.*/=$THEME/; /prefer-dark-theme/s/=.*/=false/' "${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment