mirror of
https://github.com/RustyRaptor/konsole_daynight.git
synced 2026-12-03 19:05:15 -07:00
docs: add licence and explain the detection path
The README said what it does but not how: portal color-scheme first, KDE ColorScheme string as fallback, konsolerc DefaultProfile written with kwriteconfig6. Adds requirements and a troubleshooting section, and an MIT licence file, because 'no licence' makes a repo unusable for anyone else.
This commit is contained in:
1 parent
7c34a4c501
commit
4b0d854ef8
2 files changed
+101
-49
No files matched your search
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2025 Ziad Arafat
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1,49 +1,80 @@
|
||||
# Konsole Day/Night
|
||||
A daemon to auto set your konsole profile when you change from dark and light mode in KDE
|
||||
|
||||
## Setup
|
||||
- Use uv to install dependencies and run.
|
||||
```bash
|
||||
uv venv
|
||||
uv sync
|
||||
```
|
||||
|
||||
## Config
|
||||
- By default looks for profiles named `Light` and `Dark`
|
||||
- Can configure with `--dark_profile` and `--light_profile`
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
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.
|
||||
|
||||
1. Create the systemd user directory if it doesn't exist:
|
||||
```bash
|
||||
mkdir -p ~/.config/systemd/user/
|
||||
```
|
||||
|
||||
2. Copy or link the service file:
|
||||
```bash
|
||||
# Adjust path to where you cloned the repo
|
||||
ln -s $(pwd)/systemd/user/konsole-daynight.service ~/.config/systemd/user/
|
||||
```
|
||||
|
||||
3. Reload systemd and enable the service:
|
||||
```bash
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user enable --now konsole-daynight.service
|
||||
```
|
||||
|
||||
4. Check the status:
|
||||
```bash
|
||||
systemctl --user status konsole-daynight.service
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> The service file assumes you are using `uv` and the project is located at `~/Documents/src/konsole_daynight`. If your setup is different, you may need to edit the `ExecStart` line in the service file.
|
||||
# Konsole Day/Night
|
||||
|
||||
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
|
||||
|
||||
1. Subscribes to `SettingChanged` on the xdg-desktop-portal KDE implementation over DBus and reads the
|
||||
`org.freedesktop.appearance` → `color-scheme` key (1 is light, 0 is dark).
|
||||
2. Falls back to the `org.kde.kdeglobals.General` → `ColorScheme` string when the portal stays quiet, matching
|
||||
`dark` or `light` in the scheme name.
|
||||
3. Writes `DefaultProfile` in `konsolerc` with `kwriteconfig6` so new terminals pick the profile up, and applies it
|
||||
to running Konsole sessions.
|
||||
|
||||
## Requirements
|
||||
|
||||
- KDE Plasma 6 with Konsole (the portal and `kwriteconfig6` are KDE-specific)
|
||||
- Python 3.12+ and [uv](https://docs.astral.sh/uv/): `pyproject.toml` pins the dependencies, including `pydbus` and
|
||||
`loguru`
|
||||
|
||||
## Setup
|
||||
- Use uv to install dependencies and run.
|
||||
```bash
|
||||
uv venv
|
||||
uv sync
|
||||
```
|
||||
|
||||
## Config
|
||||
- By default looks for profiles named `Light` and `Dark`
|
||||
- Can configure with `--dark_profile` and `--light_profile`
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
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.
|
||||
|
||||
1. Create the systemd user directory if it doesn't exist:
|
||||
```bash
|
||||
mkdir -p ~/.config/systemd/user/
|
||||
```
|
||||
|
||||
2. Copy or link the service file:
|
||||
```bash
|
||||
# Adjust path to where you cloned the repo
|
||||
ln -s $(pwd)/systemd/user/konsole-daynight.service ~/.config/systemd/user/
|
||||
```
|
||||
|
||||
3. Reload systemd and enable the service:
|
||||
```bash
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user enable --now konsole-daynight.service
|
||||
```
|
||||
|
||||
4. Check the status:
|
||||
```bash
|
||||
systemctl --user status konsole-daynight.service
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> The service file assumes you are using `uv` and the project is located at `~/Documents/src/konsole_daynight`. If your setup is different, you may need to edit the `ExecStart` line in the service file.
|
||||
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
```bash
|
||||
# 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`.
|
||||
Reference in new issue
Block a user