gpt
This commit is contained in:
parent
307fcbfb26
commit
1cd60b163e
133
theme-switcher
133
theme-switcher
|
@ -6,55 +6,90 @@ set_icon_theme() {
|
||||||
xfconf-query -c xsettings -p /Net/IconThemeName -n -t string -s "$1"
|
xfconf-query -c xsettings -p /Net/IconThemeName -n -t string -s "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
set_theme() {
|
enable_dark_panels() {
|
||||||
if [ "${1##*-}" = 'Light' ]; then
|
# Enable dark panels
|
||||||
yad --image "dialog-question" --title '' --buttons-layout=center --text-align=center --button='DARK':1 --button='LIGHT':0 --text "Select the panels theme\n\nNote: dark panels may result in light icons over a light theme"
|
xfconf-query -c xfce4-panel -p /panels/dark-mode -n -t bool -s true
|
||||||
case $? in
|
|
||||||
1)
|
|
||||||
# Enable dark panels
|
|
||||||
xfconf-query -c xfce4-panel -p /panels/dark-mode -n -t bool -s true
|
|
||||||
# Use the dark icon theme
|
|
||||||
set_icon_theme zafiro-dark
|
|
||||||
;;
|
|
||||||
0)
|
|
||||||
# Disable dark panels
|
|
||||||
xfconf-query -c xfce4-panel -p /panels/dark-mode -n -t bool -s false
|
|
||||||
# Use the light icon theme
|
|
||||||
set_icon_theme zafiro
|
|
||||||
;;
|
|
||||||
*) exit ;;
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
# Use the dark icon theme
|
|
||||||
set_icon_theme zafiro-dark
|
|
||||||
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"
|
|
||||||
notify-send "Skeuos-$1 theme was enabled"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export -f set_icon_theme set_theme
|
disable_dark_panels() {
|
||||||
|
# Disable dark panels
|
||||||
|
xfconf-query -c xfce4-panel -p /panels/dark-mode -n -t bool -s false
|
||||||
|
}
|
||||||
|
|
||||||
yad --no-buttons --center --keep-icon-size --use-interp --title 'TROMjaro Theme Switcher' --text-align=center --text "A Theme Switcher for TROMjaro's default theme-set (Skeuos) and icon-set (Zafiro)." --form --columns 5 \
|
show_icon_dialog() {
|
||||||
--field=!"$icons/Blue-Dark.png"!'Blue-Dark':FBTN "set_theme 'Blue-Dark'" \
|
local icon_path=$1
|
||||||
--field=!"$icons/Violet-Dark.png"!'Violet-Dark':FBTN "set_theme 'Violet-Dark'" \
|
yad --image "$icon_path" --title "Theme Icon" --window-icon=gtk-dialog-info --no-buttons --timeout=2
|
||||||
--field=!"$icons/Blue-Light.png"!'Blue-Light':FBTN "set_theme 'Blue-Light'" \
|
}
|
||||||
--field=!"$icons/Violet-Light.png"!'Violet-Light':FBTN "set_theme 'Violet-Light'" \
|
|
||||||
--field=!"$icons/Teal-Dark.png"!'Teal-Dark':FBTN "set_theme 'Teal-Dark'" \
|
set_theme() {
|
||||||
--field=!"$icons/Orange-Dark.png"!'Orange-Dark':FBTN "set_theme 'Orange-Dark'" \
|
local theme=$1
|
||||||
--field=!"$icons/Teal-Light.png"!'Teal-Light':FBTN "set_theme 'Teal-Light'" \
|
local icon_theme
|
||||||
--field=!"$icons/Orange-Light.png"!'Orange-Light':FBTN "set_theme 'Orange-Light'" \
|
local enable_dark
|
||||||
--field=!"$icons/Green-Dark.png"!'Green-Dark (default)':FBTN "set_theme 'Green-Dark'" \
|
|
||||||
--field=!"$icons/Brown-Dark.png"!'Brown-Dark':FBTN "set_theme 'Brown-Dark'" \
|
case "$theme" in
|
||||||
--field=!"$icons/Green-Light.png"!'Green-Light':FBTN "set_theme 'Green-Light'" \
|
Colloid-Grey-Dark-Nord | Colloid-Grey | Colloid-Pink | Colloid-Green | Colloid-Orange | Colloid-Purple | Colloid-Teal | Colloid-Yellow | Colloid-Pink-Dark-Nord | Colloid-Green-Dark-Nord | Colloid-Orange-Dark-Nord | Colloid-Purple-Dark-Nord | Colloid-Teal-Dark-Nord | Colloid-Yellow-Dark-Nord | Colloid-Dark-Nord)
|
||||||
--field=!"$icons/Brown-Light.png"!'Brown-Light':FBTN "set_theme 'Brown-Light'" \
|
icon_theme='zafiro-dark'
|
||||||
--field=!"$icons/Magenta-Dark.png"!'Magenta-Dark':FBTN "set_theme 'Magenta-Dark'" \
|
enable_dark=true
|
||||||
--field=!"$icons/Yellow-Dark.png"!'Yellow-Dark':FBTN "set_theme 'Yellow-Dark'" \
|
;;
|
||||||
--field=!"$icons/Magenta-Light.png"!'Magenta-Light':FBTN "set_theme 'Magenta-Light'" \
|
*)
|
||||||
--field=!"$icons/Yellow-Light.png"!'Yellow-Light':FBTN "set_theme 'Yellow-Light'" \
|
icon_theme='zafiro'
|
||||||
--field=!"$icons/Red-Dark.png"!'Red-Dark':FBTN "set_theme 'Red-Dark'" \
|
enable_dark=false
|
||||||
--field=!"$icons/Grey-Dark.png"!'Grey-Dark':FBTN "set_theme 'Grey-Dark'" \
|
;;
|
||||||
--field=!"$icons/Red-Light.png"!'Red-Light':FBTN "set_theme 'Red-Light'" \
|
esac
|
||||||
--field=!"$icons/Grey-Light.png"!'Grey-Light':FBTN "set_theme 'Grey-Light'"
|
|
||||||
|
if [ "$enable_dark" = true ]; then
|
||||||
|
enable_dark_panels
|
||||||
|
set_icon_theme "$icon_theme"
|
||||||
|
else
|
||||||
|
disable_dark_panels
|
||||||
|
set_icon_theme "$icon_theme"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Change the main theme to the chosen one
|
||||||
|
xfconf-query -c xsettings -p /Net/ThemeName -n -t string -s "$theme"
|
||||||
|
xfconf-query -c xfwm4 -p /general/theme -n -t string -s "$theme"
|
||||||
|
notify-send "$theme theme was enabled"
|
||||||
|
}
|
||||||
|
|
||||||
|
export -f set_icon_theme set_theme enable_dark_panels disable_dark_panels show_icon_dialog
|
||||||
|
|
||||||
|
yad --no-buttons --center --keep-icon-size --use-interp --title 'TROMjaro Theme Switcher' --text-align=center --text "A Theme Switcher for TROMjaro's default theme-set (Colloid) and icon-set (Zafiro)." --form --columns 8 --width=1000 --height=400 \
|
||||||
|
--field=!"$icons/Colloid-Grey.png"!'Colloid-Grey':FBTN "set_theme 'Colloid-Grey'" \
|
||||||
|
--field=!"$icons/Colloid-Grey-Light.png"!'Colloid-Grey-Light':FBTN "set_theme 'Colloid-Grey-Light'" \
|
||||||
|
--field=!"$icons/Colloid-Grey-Dark-Nord.png"!'Colloid-Grey-Dark-Nord':FBTN "set_theme 'Colloid-Grey-Dark-Nord'" \
|
||||||
|
--field=!"$icons/Colloid-Grey-Dark-Gruvbox.png"!'Colloid-Grey-Dark-Gruvbox':FBTN "set_theme 'Colloid-Grey-Dark-Gruvbox'" \
|
||||||
|
\
|
||||||
|
--field=!"$icons/Colloid-Pink.png"!'Colloid-Pink':FBTN "set_theme 'Colloid-Pink'" \
|
||||||
|
--field=!"$icons/Colloid-Pink-Light.png"!'Colloid-Pink-Light':FBTN "set_theme 'Colloid-Pink-Light'" \
|
||||||
|
--field=!"$icons/Colloid-Pink-Dark-Nord.png"!'Colloid-Pink-Dark-Nord':FBTN "set_theme 'Colloid-Pink-Dark-Nord'" \
|
||||||
|
--field=!"$icons/Colloid-Pink-Dark-Gruvbox.png"!'Colloid-Pink-Dark-Gruvbox':FBTN "set_theme 'Colloid-Pink-Dark-Gruvbox'" \
|
||||||
|
\
|
||||||
|
--field=!"$icons/Colloid-Green.png"!'Colloid-Green':FBTN "set_theme 'Colloid-Green'" \
|
||||||
|
--field=!"$icons/Colloid-Green-Light.png"!'Colloid-Green-Light':FBTN "set_theme 'Colloid-Green-Light'" \
|
||||||
|
--field=!"$icons/Colloid-Green-Dark-Nord.png"!'Colloid-Green-Dark-Nord':FBTN "set_theme 'Colloid-Green-Dark-Nord'" \
|
||||||
|
\
|
||||||
|
--field=!"$icons/Colloid-Orange.png"!'Colloid-Orange':FBTN "set_theme 'Colloid-Orange'" \
|
||||||
|
--field=!"$icons/Colloid-Orange-Light.png"!'Colloid-Orange-Light':FBTN "set_theme 'Colloid-Orange-Light'" \
|
||||||
|
--field=!"$icons/Colloid-Orange-Dark-Nord.png"!'Colloid-Orange-Dark-Nord':FBTN "set_theme 'Colloid-Orange-Dark-Nord'" \
|
||||||
|
\
|
||||||
|
--field=!"$icons/Colloid-Purple.png"!'Colloid-Purple':FBTN "set_theme 'Colloid-Purple'" \
|
||||||
|
--field=!"$icons/Colloid-Purple-Light.png"!'Colloid-Purple-Light':FBTN "set_theme 'Colloid-Purple-Light'" \
|
||||||
|
--field=!"$icons/Colloid-Purple-Dark-Nord.png"!'Colloid-Purple-Dark-Nord':FBTN "set_theme 'Colloid-Purple-Dark-Nord'" \
|
||||||
|
\
|
||||||
|
--field=!"$icons/Colloid-Teal.png"!'Colloid-Teal':FBTN "set_theme 'Colloid-Teal'" \
|
||||||
|
--field=!"$icons/Colloid-Teal-Light.png"!'Colloid-Teal-Light':FBTN "set_theme 'Colloid-Teal-Light'" \
|
||||||
|
--field=!"$icons/Colloid-Teal-Dark-Nord.png"!'Colloid-Teal-Dark-Nord':FBTN "set_theme 'Colloid-Teal-Dark-Nord'" \
|
||||||
|
\
|
||||||
|
--field=!"$icons/Colloid-Yellow.png"!'Colloid-Yellow':FBTN "set_theme 'Colloid-Yellow'" \
|
||||||
|
--field=!"$icons/Colloid-Yellow-Light.png"!'Colloid-Yellow-Light':FBTN "set_theme 'Colloid-Yellow-Light'" \
|
||||||
|
--field=!"$icons/Colloid-Yellow-Dark-Nord.png"!'Colloid-Yellow-Dark-Nord':FBTN "set_theme 'Colloid-Yellow-Dark-Nord'" \
|
||||||
|
--field=!"$icons/Colloid-Yellow-Dark-Gruvbox.png"!'Colloid-Yellow-Dark-Gruvbox':FBTN "set_theme 'Colloid-Yellow-Dark-Gruvbox'" \
|
||||||
|
\
|
||||||
|
--field=!"$icons/Colloid-Dark-Nord.png"!'Colloid-Dark-Nord':FBTN "set_theme 'Colloid-Dark-Nord'" \
|
||||||
|
--field=!"$icons/Colloid-Pink-Dark-Nord.png"!'Colloid-Pink-Dark-Nord':FBTN "set_theme 'Colloid-Pink-Dark-Nord'" \
|
||||||
|
--field=!"$icons/Colloid-Green-Dark-Nord.png"!'Colloid-Green-Dark-Nord':FBTN "set_theme 'Colloid-Green-Dark-Nord'" \
|
||||||
|
--field=!"$icons/Colloid-Orange-Dark-Nord.png"!'Colloid-Orange-Dark-Nord':FBTN "set_theme 'Colloid-Orange-Dark-Nord'" \
|
||||||
|
--field=!"$icons/Colloid-Purple-Dark-Nord.png"!'Colloid-Purple-Dark-Nord':FBTN "set_theme 'Colloid-Purple-Dark-Nord'" \
|
||||||
|
--field=!"$icons/Colloid-Teal-Dark-Nord.png"!'Colloid-Teal-Dark-Nord':FBTN "set_theme 'Colloid-Teal-Dark-Nord'" \
|
||||||
|
--field=!"$icons/Colloid-Yellow-Dark-Nord.png"!'Colloid-Yellow-Dark-Nord':FBTN "set_theme 'Colloid-Yellow-Dark-Nord'" \
|
||||||
|
--field=!"$icons/Colloid-Dark-Nord.png"!'Colloid-Dark-Nord':FBTN "set_theme 'Colloid-Dark-Nord'"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user