You are not logged in.
Pages: 1
Topic closed
Could it be done by somehow toggling the KDE 'night color' setting on/off on the command line?
Or is there any way to change the gamma in KDE on wayland via the command line?
Last edited by bedtime (2023-08-16 16:37:40)
Offline
I'm pretty sure you can do it using qdbus. Like:
To check if it's enabled:
qdbus org.kde.KWin /ColorCorrect org.kde.kwin.ColorCorrect.enabledTo get the current color temperature:
qdbus org.kde.KWin /ColorCorrect org.kde.kwin.ColorCorrect.currentTemperatureI think this works to turn it on:
qdbus org.kde.KWin /ColorCorrect org.kde.kwin.ColorCorrect.inhibitI'm not sure how to turn it off, there is a uninhibit method, but you need to use a "cookie" as an argument. You can also use the preview method to preview a specific color temperatures using org.kde.kwin.ColorCorrect.preview. For example to see how it looks like with 2500 K:
qdbus org.kde.KWin /ColorCorrect org.kde.kwin.ColorCorrect.preview 2500What I hear, I forget. What I say, I remember. What I do, I understand. –Tao Te Ching/Laozi
Offline
It won't work with qdbus. KDE expects the inhibiting DBus client to keep running and stay connected to the bus. If the client exits (eg like qdbus after it made the call) KDE automatically drops the corresponding inhibition, meaning it immediately reenables night colour.
You'll need to write a separate remote controlled Daemon which holds the inhibition cookie and stays connected to the bus to keep it alive.
Alternatively you may have success in simply disabling night colour directly in the (kwin?) configuration file with kwriteconfig, and then asking kwin or whatever controls night colour to reload its configuration (usually works over DBus).
Last edited by 3beb6e7c46a615a (2023-09-11 06:23:45)
Offline
No idea whether that works in the specific case, but you may get away w/
mkfifo /tmp/qdbus_inhibitor
qdbus … > /tmp/qdbus_inhibitor
# which should™ stay qdbus until
cat /tmp/qdbus_inhibitorOnline
Here's a command line utility: https://codeberg.org/Will_Avudim/set_KD … emperature
Offline
Thanks for the input, will_avudim .
You may want to post in Programming & Scripting subboard to discuss if this needs to be a compiled util or could be done from a script.
Welcome to forums.
Please read the General Guidelines, especially the section titled 1.5 Old threads/"necro-bumping" .
Moderator Note
Closing this old thread.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Pages: 1
Topic closed