Compare commits

..

No commits in common. "main" and "0.0.04" have entirely different histories.
main ... 0.0.04

3 changed files with 19 additions and 32 deletions

View file

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

View file

@ -51,28 +51,6 @@ 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' \
@ -96,6 +74,17 @@ 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
@ -178,9 +167,7 @@ _set_theme() {
gsettings set org.gnome.desktop.interface icon-theme "$icon_theme" gsettings set org.gnome.desktop.interface icon-theme "$icon_theme"
## QT ## QT
if [[ -x /usr/lib/plasma-changeicons ]]; then
/usr/lib/plasma-changeicons "$icon_theme" >/dev/null 2>&1 /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"
@ -209,7 +196,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=prefer-light gtk_color_scheme=default
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
@ -225,7 +212,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=prefer-light gtk_color_scheme=default
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=breeze icon_theme_light=Papirus
# Name of the dark icon theme # Name of the dark icon theme
icon_theme_dark=breeze-dark icon_theme_dark=Papirus-Dark
# Name of the light gtk theme # Name of the light gtk theme
gtk_theme_light=Breeze gtk_theme_light=adw-gtk3
# Name of the dark gtk theme # Name of the dark gtk theme
gtk_theme_dark=Breeze-Dark gtk_theme_dark=adw-gtk3-dark