You are not logged in.

#1 2023-08-16 16:37:10

bedtime
Member
Registered: 2019-02-12
Posts: 111

Changing color temperature using the command line in KDE wayland

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

#2 2023-09-10 19:41:31

Götz
Member
Registered: 2009-02-16
Posts: 30

Re: Changing color temperature using the command line in KDE wayland

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.enabled

To get the current color temperature:

qdbus org.kde.KWin /ColorCorrect org.kde.kwin.ColorCorrect.currentTemperature

I think this works to turn it on:

qdbus org.kde.KWin /ColorCorrect org.kde.kwin.ColorCorrect.inhibit

I'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 2500

What I hear, I forget. What I say, I remember. What I do, I understand.  –Tao Te Ching/Laozi

Offline

#3 2023-09-11 06:22:04

3beb6e7c46a615a
Member
Registered: 2021-03-27
Posts: 165

Re: Changing color temperature using the command line in KDE wayland

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

#4 2023-09-11 12:28:55

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,673

Re: Changing color temperature using the command line in KDE wayland

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_inhibitor

Online

#5 2026-05-24 07:44:55

will_avudim
Member
Registered: 2026-05-24
Posts: 1

Re: Changing color temperature using the command line in KDE wayland

Offline

#6 2026-05-24 09:57:57

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,041

Re: Changing color temperature using the command line in KDE wayland

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

Board footer

Powered by FluxBB