2022.07.07
This commit is contained in:
@ -2,14 +2,35 @@
|
||||
icons="$HOME"/.local/share/Theme-Switcher
|
||||
|
||||
set_theme() {
|
||||
# Check for Zafiro icon pack, icon packs won't be changed if Zafiro is not in use
|
||||
current_icon_theme=$(xfconf-query -c xsettings -p /Net/IconThemeName)
|
||||
[ "${current_icon_theme%-Icons-Light-Black-f}" = 'Zafiro' ] && Zafiro='True'
|
||||
|
||||
if [ "${1##*-}" = 'Light' ]; then
|
||||
yad --image "dialog-question" --title '' --button='DARK':1 --button='LIGHT':0 --text 'Select the panels theme:'
|
||||
case $? in
|
||||
1)
|
||||
# Enable dark panels
|
||||
xfconf-query -c xfce4-panel -p /panels/dark-mode -n -t bool -s true
|
||||
# Use the dark icon pack
|
||||
[ "$Zafiro" = 'True' ] && xfconf-query -c xsettings -p /Net/IconThemeName -n -t string -s Zafiro
|
||||
;;
|
||||
0)
|
||||
# Disable dark panels
|
||||
xfconf-query -c xfce4-panel -p /panels/dark-mode -n -t bool -s false
|
||||
# Use the light icon pack
|
||||
[ "$Zafiro" = 'True' ] && xfconf-query -c xsettings -p /Net/IconThemeName -n -t string -s Zafiro-Icons-Light-Black-f
|
||||
;;
|
||||
*) exit ;;
|
||||
esac
|
||||
else
|
||||
# Use the dark icon pack
|
||||
[ "$Zafiro" = 'True' ] && xfconf-query -c xsettings -p /Net/IconThemeName -n -t string -s Zafiro
|
||||
fi
|
||||
# Change the main theme to the chosen one
|
||||
xfconf-query -c xsettings -p /Net/ThemeName -n -t string -s "Skeuos-$1"
|
||||
xfconf-query -c xfwm4 -p /general/theme -n -t string -s "Skeuos-$1-XFWM"
|
||||
gsettings set org.gnome.desktop.interface gtk-theme "Skeuos-$1"
|
||||
if [ "${1##*-}" = 'Light' ]; then
|
||||
xfconf-query -c xsettings -p /Net/IconThemeName -n -t string -s Zafiro-Icons-Light-Black-f
|
||||
else
|
||||
xfconf-query -c xsettings -p /Net/IconThemeName -n -t string -s Zafiro
|
||||
fi
|
||||
notify-send "Skeuos-$1 theme was enabled"
|
||||
}
|
||||
export -f set_theme
|
||||
|
Reference in New Issue
Block a user