Skip to content

Instantly share code, notes, and snippets.

@ecodz
Last active July 27, 2023 11:39
Show Gist options
  • Save ecodz/1999a4a6065789d4bce8ed38b065a8e8 to your computer and use it in GitHub Desktop.
Save ecodz/1999a4a6065789d4bce8ed38b065a8e8 to your computer and use it in GitHub Desktop.
Simple XFCE Theme Switcher
#!/bin/bash
# XFCE Theme Switcher
# Created by E-Codz (https://github.com/ecodz)
######## SETTINGS ########
LIGHT_THEME="Mint-Y"
DARK_THEME="Mint-Y-Dark"
WM_LIGHT_THEME="Mint-Y"
WM_DARK_THEME="Mint-Y-Dark"
##########################
modal() {
OPTION=$(zenity --forms --add-combo "Theme:" --combo-values="Light | Dark" --text="Choose your Theme" --extra-button="Advanced Options" --title="Change the Theme")
echo "$OPTION"
if [ $OPTION = "Light" ]
then
xfconf-query -c xsettings -p /Net/ThemeName -s "$LIGHT_THEME"
xfconf-query -c xfwm4 -p /general/theme -s "$WM_LIGHT_THEME"
modal
elif [ $OPTION = "Dark" ]
then
xfconf-query -c xsettings -p /Net/ThemeName -s "$DARK_THEME"
xfconf-query -c xfwm4 -p /general/theme -s "$WM_DARK_THEME"
modal
elif [ "$OPTION" = "Advanced Options" ]
then
xfce4-appearance-settings
modal
else
exit
fi
}
modal
#!/bin/bash
# XFCE Theme Switcher
# Created by E-Codz (https://github.com/ecodz)
######## SETTINGS ########
LIGHT_THEME="Mint-Y"
DARK_THEME="Mint-Y-Dark"
WM_LIGHT_THEME="Mint-Y"
WM_DARK_THEME="Mint-Y-Dark"
##########################
modal() {
OPTION=$(zenity --forms --add-combo "Theme:" --combo-values="Hell | Dunkel" --text="Wähle dein Theme:" --extra-button="Erweiterte Optionen" --title="Theme ändern")
echo "$OPTION"
if [ $OPTION = "Hell" ]
then
xfconf-query -c xsettings -p /Net/ThemeName -s "$LIGHT_THEME"
xfconf-query -c xfwm4 -p /general/theme -s "$WM_LIGHT_THEME"
modal
elif [ $OPTION = "Dunkel" ]
then
xfconf-query -c xsettings -p /Net/ThemeName -s "$DARK_THEME"
xfconf-query -c xfwm4 -p /general/theme -s "$WM_DARK_THEME"
modal
elif [ "$OPTION" = "Erweiterte Optionen" ]
then
xfce4-appearance-settings
modal
else
exit
fi
}
modal

This is a simple theme switcher for XFCE4 available in English and German.

Installation

Just copy the file to /usr/local/bin/ and then you can run it from the terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment