Nowadays on mobile devices the ability to automatically switch between day and night themes based on sunrise/sunset or user-defined times is getting more prevalent. For instance, https://twitter.com/TwitterDesign/status/1111317722543980544, Telegram. I suggest that KDE Plasma can also provide the same on the desktop (and other platforms it works on). Already at least in the following categories of the UI we have pairs of light/dark themes: Desktop theme: Breeze Light/Dark Cursor theme: Breeze Snow and Breeze Application Color Scheme: Breeze and Breeze Dark, Solarized Light/Dark Icons: Breeze and Breeze Dark and IIANM if Katepart is set to use the KDE color scheme it will also automatically switch. So what is being requested is a mechanism for the user to instruct the system to switch the above categories automatically to specified themes at specified times or based on sunrise/sunset for the current location which may be specified or automatically determined (like the Redshift plasmoid is able to do).
It might make sense to use the Night Color KCM for this. It already has a conception of day and night. If we make it aware of color schemes, we could add a new mode that switches color schemes instead of coloring the screen.
First we'd probably want to improve the visuals of the existing color switching mechanism. Right now there's no animation or transition; the colors just abruptly jump from one set to the other. When going from light to dark and vice versa, this is a little bit jarring. Adding a very fast animation between the states might be nice.
Agreed about adding it to the night color KCM and adding a transition.
*** Bug 411874 has been marked as a duplicate of this bug. ***
*** Bug 418721 has been marked as a duplicate of this bug. ***
*** Bug 378528 has been marked as a duplicate of this bug. ***
(In reply to Nate Graham from comment #2) > First we'd probably want to improve the visuals of the existing color > switching mechanism. Right now there's no animation or transition; the > colors just abruptly jump from one set to the other. When going from light > to dark and vice versa, this is a little bit jarring. Adding a very fast > animation between the states might be nice. Also note that a gradually, almost unnoticeably slow animation has been suggested in https://bugs.kde.org/show_bug.cgi?id=378528 It might be hard to come up with nice transitions for all involved UI elements, though.
Adding an unnoticeably slow animation works for the full-screen tinting effect, but I'm not sure it would work for changing the color scheme. For example when you go form light to dark, the colors of the text and icons change from dark to light to preserve readability. If there was a very slow color change, then there would be a period of time in which both the window background and also the icons and text were gray, making them unreadable.
I was thinking about the exact same problem. One would have to consider every UI element involved and decide whether applying a slow animation makes sense there (I think there are actually elements where a slow animation will look rather nice), how they work together and what problems might come with it. I guess currently that is just out of scope.
*** Bug 430500 has been marked as a duplicate of this bug. ***
*** Bug 435894 has been marked as a duplicate of this bug. ***
Awesome!! Honestly, I'm thinking something more than that. Actually something like a "Full Switch". Let me explain. When you change a plasma style,colors,application style or simply a global theme, and then you choose a dark theme, what happens? Most of kde applications (and a few others which depend on OS settings) switch to dark mode. But what about Gnome apps? Or okular? Those will not respect the global theme settings. Also don't forget that dark mode is **NOT** just changing "Global Theme"! Sometimes, I just wanna change color scheme and that's all! A full-featured option panel can be created to set what a dark mode means to different users, and then depend on that settings, the theme would switch automatically. Also the "Auto Night Mode" feature can have options like being based on Geo location(sunrise and sunset) a manual time, or sync with your phone through kde phone. Like when you turn on Dark mode on your phone, your desktop will also become dark!! I know may or may not this relates to dark mode, but an option for making screen extra dim than the minimum brightness supported by your monitor (you can already do this trick with `xrandr --output [your output] --brightness [number between 0 to 1]`) for people who work at midnight.
Can the KDE project make use of the work of https://github.com/daehruoydeef/Yin-Yang which does exactly do this, although not exactly tide to night-color time-schedule. The implementation done by Elementary OS could be used for KDE I think.
*** Bug 447362 has been marked as a duplicate of this bug. ***
I think that this should be addressed. GNOME has this feature and it's quite convenient. For me, a simple switch between the Light/Dark theme at a time that coincides with Night Color would suffice. I wouldn't care if this switch was abrupt, that could be dealt with later.
*** Bug 453962 has been marked as a duplicate of this bug. ***
I use this bash script in the startup to automatically change Breeze Light/Dark and the wallpaper. It determines the sunrise and sunset for the site via the heliocron program: #!/bin/bash if ping -q -c 1 -W 1 8.8.8.8 >/dev/null; then longitude=$(curl ipinfo.io | jq -c ".loc" | tr -d '"' | awk -F',' '{print $1}') latitude=$(curl ipinfo.io | jq -c ".loc" | tr -d '"' | awk -F',' '{print $2}') if [ ! -f "/home/user/.location" ]; then echo "$longitude $latitude" > /home/user/.location else read -r longialt latialt < /home/user/.location if [ 1 != $(awk -v a="$latialt" -v b="$latitude" 'BEGIN{print(a==b)}') ] || [ 1 != $(awk -v a="$longialt" -v b="$longitude" 'BEGIN{print(a==b)}') ]; then cat /home/user/.location > /home/user/.locationalt echo "$longitude $latitude" > /home/user/.location fi fi elif [ -f "/home/user/.location" ]; then read -r longitude latitude < /home/user/.location else longitude=<defautlo> latitude=<defaultla> fi daystart=$(heliocron -l $longitude -o $latitude report | grep Sunrise | grep -o '[0-9][0-9]:[0-9][0-9]:[0-9][0-9]') daystop=$(heliocron -l $longitude -o $latitude report | grep Sunset | grep -o '[0-9][0-9]:[0-9][0-9]:[0-9][0-9]') currenttime=$(date +%H:%M:%S) nextday=$(date --date="next day" +%F) # thisday=$(date +%F) if [[ "$currenttime" > "$daystart" ]] && [[ "$currenttime" < "$daystop" ]]; then lookandfeeltool -a org.kde.breeze.desktop plasma-apply-wallpaperimage /home/user/Bilder/Background/Taucher1920x1080.jpg heliocron -l $longitude -o $latitude wait -e sunset && lookandfeeltool -a org.kde.breezedark.desktop && plasma-apply-wallpaperimage /home/user/Bilder/Background/DarkestHour1920x1080.jpg sleep 2m heliocron -d $nextday -l $longitude -o $latitude wait -e sunrise && lookandfeeltool -a org.kde.breeze.desktop && plasma-apply-wallpaperimage /home/user/Bilder/Background/Taucher1920x1080.jpg else lookandfeeltool -a org.kde.breezedark.desktop plasma-apply-wallpaperimage /home/user/Bilder/Background/DarkestHour1920x1080.jpg if [[ "$currenttime" > "$daystop" ]]; then heliocron -d $nextday -l $longitude -o $latitude wait -e sunrise && lookandfeeltool -a org.kde.breeze.desktop && plasma-apply-wallpaperimage /home/user/Bilder/Background/Taucher1920x1080.jpg sleep 2m heliocron -l $longitude -o $latitude wait -e sunset && lookandfeeltool -a org.kde.breezedark.desktop && plasma-apply-wallpaperimage /home/user/Bilder/Background/DarkestHour1920x1080.jpg else heliocron -l $longitude -o $latitude wait -e sunrise && lookandfeeltool -a org.kde.breeze.desktop && plasma-apply-wallpaperimage /home/user/Bilder/Background/Taucher1920x1080.jpg sleep 2m heliocron -l $longitude -o $latitude wait -e sunset && lookandfeeltool -a org.kde.breezedark.desktop && plasma-apply-wallpaperimage /home/user/Bilder/Background/DarkestHour1920x1080.jpg fi fi
There seem to be some applications that provide exactly this setting: https://github.com/baduhai/Koi https://github.com/oskarsh/Yin-Yang https://github.com/Professor-Paradox/KdeAutoThemeSwitch (seems to be inactive) However, I would strongly prefer to have it in KDE directly. My hope is that, in this case, user applications can check the global theming and adapt itself automatically (browsers, color schemes in terminal emulators, ...).
This is being worked on: https://invent.kde.org/plasma/plasma-workspace/-/issues/59 Until then, here is two more options to do it: - https://gitlab.com/WhyNotHugo/darkman - https://gitlab.com/LADlSLAV/yabotss (can be used with the former)
*** Bug 481021 has been marked as a duplicate of this bug. ***
*** Bug 482454 has been marked as a duplicate of this bug. ***
*** Bug 493175 has been marked as a duplicate of this bug. ***
this feature request has been submitted since 2019..!? and i did one more today 16/09/2024 (Bug 493175). i support secretly kde/plasma to get more resource so as to address/implement high level issues-features but sometimes I wonder what is the logic behind all these new features that are sometimes half-developed. This is the case here: before playing on the screen brightness and color attributes it would be more obvious to first implement for this module a parameter alternating between light/dark color. It seems to me that the child comes on earth before his parents? but as the expression says: users propose and programmers dispose. Maybe for plasma 6.3
(In reply to Gerion from comment #18) > There seem to be some applications that provide exactly this setting: > https://github.com/baduhai/Koi > https://github.com/oskarsh/Yin-Yang > https://github.com/Professor-Paradox/KdeAutoThemeSwitch (seems to be > inactive) > > However, I would strongly prefer to have it in KDE directly. My hope is > that, in this case, user applications can check the global theming and adapt > itself automatically (browsers, color schemes in terminal emulators, ...). @Gerion: thanks a lot, you save my day with Koi
(In reply to Cherkah from comment #24) > (In reply to Gerion from comment #18) > > There seem to be some applications that provide exactly this setting: > > https://github.com/baduhai/Koi > > https://github.com/oskarsh/Yin-Yang > > https://github.com/Professor-Paradox/KdeAutoThemeSwitch (seems to be > > inactive) > > > > However, I would strongly prefer to have it in KDE directly. My hope is > > that, in this case, user applications can check the global theming and adapt > > itself automatically (browsers, color schemes in terminal emulators, ...). > > @Gerion: thanks a lot, you save my day with Koi Hello, Yes, it is me/us who provides the software. In any case of feedback / information / co-operation feel free to write/ask me either here or on the GitHub repository: https://github.com/baduhai/Koi
allow me to mention, hoping it may help others looking for a quick solution as i did, that as a temporary workaround there is way to switch the global theme with the command line "lookandfeeltool": https://userbase.kde.org/System_Settings/Look_And_Feel/en so, a lookandfeeltool -a org.kde.breeze.desktop for example, can be easily used in a bash script on startup, to set the globale theme according to the sunset. i made a very amateur minimalistic attempt with bash and GPT, which may suit somebodies needs as it does the job for me: https://discuss.kde.org/t/minimalistic-daytime-global-themeswitcher-script/25263/2 thank you for this wonderful work you're doing here with KDE! best, me (-:
Hi there, are there any news about this? I read most of the comments, and I think that to keep things simple would be more than enough. Just a night/day based switching of the Global Theme, abruptly (that's also how Android does it, for example). Handling this via the night light module seems to make sense to me as well. Thanks
I created 2 variation of such plasma auto theme switching bash script using: a. Webcam b. Laptop illuminance sensor Apart changing to breezeDark/breeze accordingly it also uses dbus6 to adjust screen brigthtness. TO avoid flickering up/down brightness I added hystheresis. https://gitlab.com/polrus/linux-improvements