Konsole Day/Night
Note: the "How it works", "Requirements" and "Troubleshooting" sections of this README were written by an AI assistant (Particle-1) on the maintainer's behalf on 2026-12-01, by reading the code. The original daemon and its setup notes are the maintainer's; corrections welcome.
A daemon that switches your Konsole colour profile when Plasma flips between dark and light mode. Plasma changes its own colours on schedule or on sunrise and sunset; the terminal does not, and a light background in a dark session is the sort of thing you notice twenty times a day.
How it works
- Subscribes to
SettingChangedon the xdg-desktop-portal KDE implementation over DBus and reads theorg.freedesktop.appearance→color-schemekey (1 is light, 0 is dark). - Falls back to the
org.kde.kdeglobals.General→ColorSchemestring when the portal stays quiet, matchingdarkorlightin the scheme name. - Writes
DefaultProfileinkonsolercwithkwriteconfig6so new terminals pick the profile up, and applies it to running Konsole sessions.
Requirements
- KDE Plasma 6 with Konsole (the portal and
kwriteconfig6are KDE-specific) - Python 3.12+ and uv:
pyproject.tomlpins the dependencies, includingpydbusandloguru
Setup
- Use uv to install dependencies and run.
uv venv
uv sync
Config
- By default looks for profiles named
LightandDark - Can configure with
--dark_profileand--light_profile
Usage
uv run konsoltheme --dark_profile "Dark" --light_profile "Light"
Systemd Auto-start
You can use the provided systemd unit file to automatically start the background process when you log in.
-
Create the systemd user directory if it doesn't exist:
mkdir -p ~/.config/systemd/user/ -
Copy or link the service file:
# Adjust path to where you cloned the repo ln -s $(pwd)/systemd/user/konsole-daynight.service ~/.config/systemd/user/ -
Reload systemd and enable the service:
systemctl --user daemon-reload systemctl --user enable --now konsole-daynight.service -
Check the status:
systemctl --user status konsole-daynight.service
Note
The service file assumes you are using
uvand the project is located at~/Documents/src/konsole_daynight. If your setup is different, you may need to edit theExecStartline in the service file.
Troubleshooting
# see what the listener is receiving
uv run konsoltheme --dark_profile "Dark" --light_profile "Light" 2>&1 | grep -i "DBus signal"
# the profile names must match what Konsole shows under Settings -> Manage Profiles
kreadconfig6 --file konsolerc --group "Desktop Entry" --key DefaultProfile
Logs go to the journal when started from the unit: journalctl --user -u konsole-daynight -f.