How to make the whole screen grayscale in KDE (wayland)?

Is there any way to make the whole screen grayscale in KDE, just like modern Android phones?

This feature is available on X11 via compiz Setting a greyscale (or monochrome) color scheme - Ask Ubuntu

Also available on GNOME via some extensions https://www.reddit.com/r/Ubuntu/comments/s412xc/is_there_a_way_to_make_my_display_grayscale_on/

It would be nice to have this feature in modern KDE, with Wayland.

2 Likes

This is also available in Cinnamon [desaturate-all@hkoosha] -- Add ability to set a timer (like bedtime mode) · Issue #7103 · linuxmint/cinnamon-spices-applets · GitHub

Hi - well, my first thought on that would be to turn the saturation on your display all the way down to 0, but that might not be possible on laptops, or some standalone displays!

I’m not aware of a built-in software method for making the screen grayscale, but if you’re willing to investigate the security of it and potentially use it, there’s an add-on that claims to do this: GitHub - lliurex/kwin-grayscale-effect: KWin Grayscale Effect

1 Like

Here is how to make the repo shared by @johnandmegh work with plasma6. This is based on Small changes to README.md to match the new branch by bmbeverst · Pull Request #2 · lliurex/kwin-grayscale-effect · GitHub, but with slight changes to adapt to plasma 6.

  1. Download the version appropriate for Plasma6 from https://github.com/lliurex/kwin-grayscale-effect/archive/refs/heads/plasma6.zip

  2. Extract the zip archive, if downloaded.


unzip kwin-grayscale-effect-plasma6.zip

  1. Enter the repository directory cd kwin-grayscale-effect-plasma6

  2. Install the plugin


kpackagetool6 --type KWin/Effect --install kwin6_effect_grayscale

Copy “kwin6_effect_grayscale/metadata.json” to “/usr/share/kwin/”, using e.g.

sudo cp metadata.json /usr/share/kwin/

Now go to system settings -> Window Management -> Desktop Effects and Enable Grayscale

In KDE6, this effect has a bug –

After a panel autohides - a non-clickable replica of the panel is created. It is just an image (clicking on it does nothing).

See this post above How to make the whole screen grayscale in KDE (wayland)? - #4 by archisman to set up the grayscale effect.

To assign a shortcut for Toggling Grayscale effect, go to system settings → keyboard → shortcuts and click on “Add New → Command or Script”. After that, for the command, use

bash -c 'qdbus org.kde.KWin /Effects org.kde.kwin.Effects.isEffectLoaded kwin6_effect_grayscale | grep -q true && qdbus org.kde.KWin /Effects org.kde.kwin.Effects.unloadEffect kwin6_effect_grayscale || qdbus org.kde.KWin /Effects org.kde.kwin.Effects.loadEffect kwin6_effect_grayscale'

And name it something like “Toggle Grayscale”.

I am using ctrl + meta + c, for toggling – the same key combination works in Windows.

I would be curious to understand what is the use-case.

Is it for battery use ?
To use the screen to display random things ?
Workaround not functioning screens ?
I can only make guesses.

@meven
Most importantly, it is for soothing the eyes.
If someone needs to look at their phone at night, the grayscale mode puts significantly less strain on the eyes (having minor vision issues which are triggered by strain due to long usage of screen, I can say it does help a lot).

Moreover, looking at colorful imagery before going to sleep may partially contribute to insomnia (even with a blue light filter) – grayscale mode doesn’t have that much impact.

Also, research shows that grayscale mode helps dealing with phone addiction https://www.nytimes.com/2018/01/12/technology/grayscale-phone.html. It should also apply to internet addiction on a computer.

The grayscale mode may have the added benefit of reducing battery use, but I am unsure about that.

Many modern phones provide such a grayscale mode at night, in addition to a night light mode.
KDE already features Night Light. It would be great if KDE offers a Grayscale bedtime mode.

I think it would be accepted in KWin.
Hooking it up to night-light could be nice.

The code is pretty simple.

Should I open a bug report in Kwin for that? It seems that the code for kwin-grayscale-effect is abandoned (the plasma6 version was a fork, which, too, seems to be abandoned). It would be nice if KDE devs adopt it.

Yes you can open a feature request.
That’s the only way to actually ask devs to do anything.

In this case there is already a feature request 485304 – Grayscale filter option in desktop effects

1 Like

I added this post’s link in that feature request page. Is there anything else I can do to increase the visibility of this issue to the developers?

That’s great, this allows to measure the interest for the feature.