feat: use kitty auto dark mode added in 0.38.0

This commit is contained in:
grassblock 2025-01-01 11:23:15 +08:00
parent 4563589831
commit 2976fbab63
10 changed files with 63 additions and 18 deletions

View file

@ -1,6 +1,10 @@
#!/usr/bin/env bash
# add a detection to prevent exec scripts on every login
#if [[ "$(darkman get)" =~ "dark" ]]; then
# trigger a small, passive popup dialog to inform the user about darkman's activity
# reference https://wiki.archlinux.org/title/Desktop_notifications#Usage_in_programming
notify-send --app-name="darkman" --urgency=low --icon=weather-clear "switching to light mode"
notify-send --app-name="darkman" --urgency=low --icon=weather-clear "switching to light mode"
#fi

View file

@ -1,6 +1,8 @@
#!/usr/bin/env bash
# Change the global Plasma Theme. On Manjaro you can use "org.manjaro.breath-light.desktop"
# add a detection to prevent exec scripts on every login
#if [[ "$(darkman get)" =~ "dark" ]] ; then
# Change the global Plasma Theme. On Manjaro you can use "org.manjaro.breath-light.desktop"
# or you can create your own global Plasma Theme with the "Plasma Look And Feel Explorer".
# Reference: https://userbase.kde.org/Plasma/Create_a_Global_Theme_Package
#
@ -10,12 +12,6 @@
# Global Theme
lookandfeeltool -platform offscreen --apply "Utterly-Nord-Light"
# Window decoration
# https://askubuntu.com/questions/1183294/switching-plasma-theme-from-the-command-line
kwriteconfig6 --file ~/.config/kwinrc --group org.kde.kdecoration2 --key library org.kde.klassy
kwriteconfig6 --file ~/.config/kwinrc --group org.kde.kdecoration2 --key theme Klassy
# Icon theme
/usr/lib/plasma-changeicons Papirus-Light
@ -25,5 +21,20 @@ flatpak run --command="gradience-cli" com.github.GradienceTeam.Gradience apply -
# application style
kwriteconfig6 --file kdeglobals --group KDE --key widgetStyle Lightly
# Window decoration
# https://askubuntu.com/questions/1183294/switching-plasma-theme-from-the-command-line
kwriteconfig6 --file ~/.config/kwinrc --group org.kde.kdecoration2 --key library org.kde.klassy
kwriteconfig6 --file ~/.config/kwinrc --group org.kde.kdecoration2 --key theme Klassy
# make kwin to reload config
# https://invent.kde.org/plasma/kwin/-/blob/master/src/kcms/decoration/kwin-applywindowdecoration.cpp#L95
# https://develop.kde.org/docs/plasma/kwin/#installation
dbus-send --session --type=signal /Kwin org.kde.KWin.reloadConfig
qdbus org.kde.KWin /KWin org.kde.KWin.reconfigure
# notify
notify-send --app-name="darkman" --urgency=low --icon=weather-clear "theme switch success. to make them fully take effect, please logout and login again."
#else
# echo "The global theme has been already switched,skipping"
#fi

View file

@ -1,7 +1,12 @@
#!/usr/bin/env bash
# add a detection to prevent exec scripts on every login
#if [[ "$(darkman get)" =~ "dark" ]] ; then
# GTK apps are not affected by the Plasma Global Theme, which only applies to Qt based programs.
# GTK themes can be installed here: Global Theme > Application Style > Configure GNOME/GTK Application Style.
# Reference: https://wiki.archlinux.org/title/Uniform_look_for_Qt_and_GTK_applications
dbus-send --session --dest=org.kde.GtkConfig --type=method_call /GtkConfig org.kde.GtkConfig.setGtkTheme "string:Graphite-Light-nord"
#else
# echo "The GTK theme has been already switched, skipping"
#fi