Bug 400418 - Applet to control Night Color feature from the system tray
Summary: Applet to control Night Color feature from the system tray
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: 5.17.1
Platform: unspecified Linux
: NOR wishlist
Target Milestone: 1.0
Assignee: Sebastian Kügler
URL:
Keywords:
: 413073 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-10-28 13:23 UTC by Patrick Silva
Modified: 2020-01-08 06:44 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.18.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2018-10-28 13:23:42 UTC
Redshift has an applet to control color temperature and disable night color feature
temporarily in the system tray.
https://store.kde.org/p/998916/

An applet with the same features to control native Night Color on Wayland would be nice.

SOFTWARE VERSIONS
Arch Linux
KDE Plasma Version: 5.14.2
KDE Frameworks Version: 5.51
Qt Version: 5.12 beta3
Comment 1 Patrick Silva 2019-03-24 13:40:01 UTC
This feature is still missing in plasma 5.15.3. :(
Comment 2 Björn Feber 2019-10-17 11:27:03 UTC
*** Bug 413073 has been marked as a duplicate of this bug. ***
Comment 3 Philippe ROUBACH 2019-10-17 11:33:56 UTC
For kde/X11 Night Color

We need a command line to switch on/off if we use for example VLC or Digikam according a script to launch it as this:

night color switch off
VLC
night color switch on

or perhaps we need just a dbus command

or something as for redshift

pkill -USR1 redshift
/usr/bin/vlc
pkill -USR1 redshift


Also we need in the systray an on/off swith as for redshift.


Thanks
Comment 4 Stefan Zurucker 2019-10-26 21:05:32 UTC
I would like to emphasize the importance/convenience of this request. It's good to have the setting available in the system settings, but it's not the most visible or convenient place for the user to toggle Night Color.

Having a switch in the tray that exposes the settings as well as enabling the user to turn it on and off at the press of a button (like the Redshift control applet) would make Night Color feature-complete, imho, and just simplify things for the user.

Thanks for your time!

PS: Changed the Plasma Version and Platform in order to better reflect the general context of this feature request.
Comment 5 Vlad Zahorodnii 2020-01-07 15:13:56 UTC
Git commit 5bec89ac90d5c9d72b03b60cf62bb6ef9ffb0808 by Vlad Zahorodnii.
Committed on 07/01/2020 at 15:12.
Pushed by vladz into branch 'master'.

[nightcolor] Introduce inhibition API

Summary:
The new API allows to block Night Color temporarily. This can be useful
for applications such as video games and plasma applets.

Test Plan: Called inhibit() and uninhibit() from D-Feet.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25786

M  +77   -0    colorcorrection/colorcorrectdbusinterface.cpp
M  +22   -1    colorcorrection/colorcorrectdbusinterface.h
M  +46   -33   colorcorrection/manager.cpp
M  +30   -0    colorcorrection/manager.h
M  +34   -0    org.kde.kwin.ColorCorrect.xml

https://commits.kde.org/kwin/5bec89ac90d5c9d72b03b60cf62bb6ef9ffb0808
Comment 6 Vlad Zahorodnii 2020-01-07 15:13:56 UTC
Git commit 33f46f6d6c10ae6fcedad51f932d34907bb6e749 by Vlad Zahorodnii.
Committed on 07/01/2020 at 15:12.
Pushed by vladz into branch 'master'.

[nightcolor] Expose some properties to d-bus

Summary:
Currently, in order to retrieve the current screen color temperature
applied to all screen as well other attributes of night color manager,
one has to call nightColorInfo() periodically. This goes against well
established patterns in d-bus world. It is recommended to expose a
bunch of d-bus properties rather than have a method that returns all
relevant properties stored in a JSON object.

The ugliest thing about this patch is that a lot of code is duplicated
to emit the PropertiesChanged signal. Unfortunately, QtDBus doesn't
take care of this and we are left with only two options - either do
weird things with QMetaObject or manually emit the signal. I have
picked the second option since it's more comprehensible and less magic
is going on, but I have to admit that the chosen approach is ugly.

I hope that "Qt 6 will fix it."

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25946

M  +125  -1    colorcorrection/colorcorrectdbusinterface.cpp
M  +12   -0    colorcorrection/colorcorrectdbusinterface.h
M  +97   -14   colorcorrection/manager.cpp
M  +62   -0    colorcorrection/manager.h
M  +32   -0    org.kde.kwin.ColorCorrect.xml

https://commits.kde.org/kwin/33f46f6d6c10ae6fcedad51f932d34907bb6e749
Comment 7 Vlad Zahorodnii 2020-01-07 15:31:54 UTC
Git commit a18bc820ca90e777fee4eaa4b6b6ccc7cb1da9ac by Vlad Zahorodnii.
Committed on 07/01/2020 at 15:31.
Pushed by vladz into branch 'master'.

Add applet for controlling Night Color

Summary:
The new applet allows to temporarily disable Night Color, for example if
one wants to edit a video or an image.

Reviewers: #plasma, #vdg, ngraham, davidedmundson

Reviewed By: #plasma, #vdg, ngraham, davidedmundson

Subscribers: davidedmundson, ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D25947

M  +1    -0    applets/CMakeLists.txt
A  +3    -0    applets/nightcolor/CMakeLists.txt
A  +2    -0    applets/nightcolor/Messages.sh
A  +108  -0    applets/nightcolor/package/contents/ui/main.qml     [License: GPL (v2+)]
A  +21   -0    applets/nightcolor/package/metadata.desktop
A  +16   -0    applets/nightcolor/plugin/CMakeLists.txt
A  +141  -0    applets/nightcolor/plugin/inhibitor.cpp     [License: GPL (v2+)]
A  +85   -0    applets/nightcolor/plugin/inhibitor.h     [License: GPL (v2+)]
A  +238  -0    applets/nightcolor/plugin/monitor.cpp     [License: GPL (v2+)]
A  +113  -0    applets/nightcolor/plugin/monitor.h     [License: GPL (v2+)]
A  +63   -0    applets/nightcolor/plugin/monitor_p.h     [License: GPL (v2+)]
A  +29   -0    applets/nightcolor/plugin/plugin.cpp     [License: GPL (v2+)]
A  +29   -0    applets/nightcolor/plugin/plugin.h     [License: GPL (v2+)]
A  +2    -0    applets/nightcolor/plugin/qmldir

https://commits.kde.org/kdeplasma-addons/a18bc820ca90e777fee4eaa4b6b6ccc7cb1da9ac
Comment 8 Philippe ROUBACH 2020-01-07 16:12:37 UTC
Thanks

 but what about a command line to switch on/off according to use it in a script ?

as i ask for in comment #3 ?
Comment 9 Vlad Zahorodnii 2020-01-07 23:08:15 UTC
You can inhibit Night Color from command line, but it's not that easy. qdbus is not good for this purpose because it immediately exits. You would need a python script (https://paste.ubuntu.com/p/5njhcxYXcr/) or something, which runs in background. The script just sends an inhibit request and after that is doing nothing. When you're done, kill the python script.

We don't allow doing things like this

    night-color-manager switch off
    foobar
    night-color-manager switch on

because we don't want random applications to clobber running state of Night Color.
Comment 10 Vlad Zahorodnii 2020-01-07 23:31:44 UTC
Alternatively, you could use a "wrapper" script that inhibits night color and launches application, e.g.

    night-color-inhibit executable --arg1 --arg2 ...
Comment 11 Philippe ROUBACH 2020-01-08 06:44:32 UTC
(In reply to Vlad Zahorodnii from comment #10)
> Alternatively, you could use a "wrapper" script that inhibits night color
> and launches application, e.g.
> 
>     night-color-inhibit executable --arg1 --arg2 ...

ok thanks