Compare commits

..

6 commits
0.0.04 ... main

Author SHA1 Message Date
17095c11c8
version 0.0.05 2025-12-11 19:18:32 +01:00
4d66a77089
bugfix: set Breeze theme as default in config file 2025-12-11 19:17:09 +01:00
8b62fd4ed4
merge testing 2025-12-11 19:12:44 +01:00
216f3866cb
bugfix: more QT checking
- check for QT_QPA_PLATFORMTHEME=qt6ct
    - make plasma-changeicons optional
2025-12-11 19:05:25 +01:00
16f3a541dd
merge bugfixes 2025-12-09 10:53:01 +00:00
53e31eee65
fix(color-scheme): use prefer-light instead of default
default will show some context-menus e.g. waybar-tray in dark
2025-12-09 10:42:46 +00:00
3 changed files with 32 additions and 19 deletions

View file

@ -1,4 +1,4 @@
VERSION = 0.0.04 VERSION = 0.0.05
PN = night-theme-switcher PN = night-theme-switcher
PREFIX ?= /usr PREFIX ?= /usr

View file

@ -51,6 +51,28 @@ readonly all_off bold blue green red yellow
### End insert of Arch script ### End insert of Arch script
# dependency checks probably not needed but they do not hurt # dependency checks probably not needed but they do not hurt
if [ ! "$QT_QPA_PLATFORMTHEME" == "qt6ct" ]; then
notify-send \
'Wrong environment variable' \
'Please set QT_QPA_PLATFORMTHEME=qt6ct.' \
-h string:x-canonical-private-synchronous:sys-notify \
-u critical \
-i dialog-error
mesg="environment variable QT_QPA_PLATFORMTHEME=qt6ct is not set."
echo -e "${red}==> ERROR:${all_off}${bold} ${mesg}${all_off}"
exit 1
fi
if ! command -v breeze-settings6 >/dev/null 2>&1; then
notify-send \
'Missing dependency' \
'Please install breeze.' \
-h string:x-canonical-private-synchronous:sys-notify \
-u critical \
-i dialog-error
mesg="breeze is required to use this script."
echo -e "${red}==> ERROR:${all_off}${bold} ${mesg}${all_off}"
exit 1
fi
if ! command -v qt6ct >/dev/null 2>&1; then if ! command -v qt6ct >/dev/null 2>&1; then
notify-send \ notify-send \
'Missing dependency' \ 'Missing dependency' \
@ -74,17 +96,6 @@ if ! command -v gsettings >/dev/null 2>&1; then
echo -e "${red}==> ERROR:${all_off}${bold} ${mesg}${all_off}" echo -e "${red}==> ERROR:${all_off}${bold} ${mesg}${all_off}"
exit 1 exit 1
fi fi
if ! command -v /usr/lib/plasma-changeicons >/dev/null 2>&1; then
notify-send \
'Missing dependency' \
'plasma-changeicons not found.\nPlease install plasma-workspace.' \
-h string:x-canonical-private-synchronous:sys-notify \
-u critical \
-i dialog-error
mesg="plasma-workspace is required to use this script."
echo -e "${red}==> ERROR:${all_off}${bold} ${mesg}${all_off}"
exit 1
fi
check_config() { check_config() {
if [[ ! -f $default_config_file ]]; then if [[ ! -f $default_config_file ]]; then
@ -167,7 +178,9 @@ _set_theme() {
gsettings set org.gnome.desktop.interface icon-theme "$icon_theme" gsettings set org.gnome.desktop.interface icon-theme "$icon_theme"
## QT ## QT
/usr/lib/plasma-changeicons "$icon_theme" >/dev/null 2>&1 if [[ -x /usr/lib/plasma-changeicons ]]; then
/usr/lib/plasma-changeicons "$icon_theme" >/dev/null 2>&1
fi
if [[ -w "$HOME/.config/qt5ct/qt5ct.conf" ]]; then if [[ -w "$HOME/.config/qt5ct/qt5ct.conf" ]]; then
sed -i "s/icon_theme=.*/icon_theme=$icon_theme/g" \ sed -i "s/icon_theme=.*/icon_theme=$icon_theme/g" \
"$HOME/.config/qt5ct/qt5ct.conf" "$HOME/.config/qt5ct/qt5ct.conf"
@ -196,7 +209,7 @@ switch-dark-light() {
qt_color_scheme_path=$kcolorscheme_dark qt_color_scheme_path=$kcolorscheme_dark
_set_theme _set_theme
else else
gtk_color_scheme=default gtk_color_scheme=prefer-light
gtk_prefer_dark_theme=0 gtk_prefer_dark_theme=0
gtk_theme=$gtk_theme_light gtk_theme=$gtk_theme_light
icon_theme=$icon_theme_light icon_theme=$icon_theme_light
@ -212,7 +225,7 @@ restore-theme-on-login() {
gtk_color_scheme=$(gsettings get org.gnome.desktop.interface color-scheme) gtk_color_scheme=$(gsettings get org.gnome.desktop.interface color-scheme)
if [[ ! $gtk_color_scheme == ''\''prefer-dark'\''' ]]; then if [[ ! $gtk_color_scheme == ''\''prefer-dark'\''' ]]; then
gtk_color_scheme=default gtk_color_scheme=prefer-light
gtk_prefer_dark_theme=0 gtk_prefer_dark_theme=0
gtk_theme=$gtk_theme_light gtk_theme=$gtk_theme_light
icon_theme=$icon_theme_light icon_theme=$icon_theme_light

View file

@ -5,13 +5,13 @@ kcolorscheme_light="/usr/share/color-schemes/BreezeLight.colors"
kcolorscheme_dark="/usr/share/color-schemes/BreezeDark.colors" kcolorscheme_dark="/usr/share/color-schemes/BreezeDark.colors"
# Name of the light icon theme # Name of the light icon theme
icon_theme_light=Papirus icon_theme_light=breeze
# Name of the dark icon theme # Name of the dark icon theme
icon_theme_dark=Papirus-Dark icon_theme_dark=breeze-dark
# Name of the light gtk theme # Name of the light gtk theme
gtk_theme_light=adw-gtk3 gtk_theme_light=Breeze
# Name of the dark gtk theme # Name of the dark gtk theme
gtk_theme_dark=adw-gtk3-dark gtk_theme_dark=Breeze-Dark