this post was submitted on 14 Sep 2025
8 points (90.0% liked)

KDE & Plasma users

3255 readers
1 users here now

KDE is an international technology team creating user-friendly free and open source software for desktop and portable computing. KDE's software runs on GNU/Linux, BSD and other operating systems, including Windows.

founded 6 years ago
MODERATORS
8
submitted 4 months ago* (last edited 4 months ago) by glitching@lemmy.ml to c/kde@lemmy.ml
 

doing a writeup for myself so why not let others in on the thing.

so the main tool is darkman. install instructions are on the github, it's in the package manager on a lot of distros. after install and starting the service, all that's needed is to create:

$ mkdir -p ~/.local/share/{light,dark}-mode.d/

not a fan of this layout, a single hook woulda been enough, but what do I know. anyhoo, we need the script to switch the theme:

$ nano ~/.local/share/light-mode.d/light.sh

#!/usr/bin/env bash
export WAYLAND_DISPLAY=wayland-0
export QT_QPA_PLATFORM=wayland
export DISPLAY=:0

plasma-apply-colorscheme BreezeLight

and the inverse for dark:

$ nano ~/.local/share/dark-mode.d/dark.sh

#!/usr/bin/env bash
export WAYLAND_DISPLAY=wayland-0
export QT_QPA_PLATFORM=wayland
export DISPLAY=:0

plasma-apply-colorscheme BreezeDark

make both scripts executable:

$ chmod +x .local/share/{light,dark}-mode.d/*.sh

you can optionally change wallpapers, icons, etc. in them scripts.

and that's it. works fine, you can hardcode the hours for switching, otherwise it uses your coarse location for determining sunrise/sunset. most QT and GTK apps follow the new setting instantly, some still don't, you need to restart them. you can use darkman get to return the current mode, for shell scripts and such.

top 1 comments
sorted by: hot top controversial new old
[–] ashema@sopuli.xyz 4 points 4 months ago