diff --git a/Makefile b/Makefile index 08fd05d..43dcb38 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION = 0.0.04 +VERSION = 0.0.05 PN = night-theme-switcher PREFIX ?= /usr diff --git a/common/night-theme-switcher.in b/common/night-theme-switcher.in index 89525a8..6c8ab79 100755 --- a/common/night-theme-switcher.in +++ b/common/night-theme-switcher.in @@ -51,6 +51,28 @@ readonly all_off bold blue green red yellow ### End insert of Arch script # 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 notify-send \ '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}" exit 1 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() { if [[ ! -f $default_config_file ]]; then @@ -167,7 +178,9 @@ _set_theme() { gsettings set org.gnome.desktop.interface icon-theme "$icon_theme" ## 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 sed -i "s/icon_theme=.*/icon_theme=$icon_theme/g" \ "$HOME/.config/qt5ct/qt5ct.conf" @@ -196,7 +209,7 @@ switch-dark-light() { qt_color_scheme_path=$kcolorscheme_dark _set_theme else - gtk_color_scheme=default + gtk_color_scheme=prefer-light gtk_prefer_dark_theme=0 gtk_theme=$gtk_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) if [[ ! $gtk_color_scheme == ''\''prefer-dark'\''' ]]; then - gtk_color_scheme=default + gtk_color_scheme=prefer-light gtk_prefer_dark_theme=0 gtk_theme=$gtk_theme_light icon_theme=$icon_theme_light diff --git a/common/nts.skel b/common/nts.skel index f98df54..4ad2dae 100644 --- a/common/nts.skel +++ b/common/nts.skel @@ -5,13 +5,13 @@ kcolorscheme_light="/usr/share/color-schemes/BreezeLight.colors" kcolorscheme_dark="/usr/share/color-schemes/BreezeDark.colors" # Name of the light icon theme -icon_theme_light=Papirus +icon_theme_light=breeze # Name of the dark icon theme -icon_theme_dark=Papirus-Dark +icon_theme_dark=breeze-dark # Name of the light gtk theme -gtk_theme_light=adw-gtk3 +gtk_theme_light=Breeze # Name of the dark gtk theme -gtk_theme_dark=adw-gtk3-dark +gtk_theme_dark=Breeze-Dark