4

How can I use KWin to obtain a grayscale effect in Kubuntu 18.04?

DK Bose
  • 42,548
  • 23
  • 127
  • 221

1 Answers1

3

Murat Çileli has developed KWin Grayscale Effect which, according to this reddit thread is

a fullscreen, configurable grayscale effect for KWin / KDE

If you want this effect,

  • Download the tar and extract it.

  • Run sudo cp -r kwin4_effect_grayscale /usr/share/kwin/effects

  • Run sudo cp kwin4_effect_grayscale.desktop /usr/share/kservices5/kwin

  • And edit the [Plugins] section of ~/.config/kwinrc to have kwin4_effect_grayscaleEnabled=true on its own line. In case the [Plugins] section is missing from your kwinrc, just add it.

To test it for the first time, open System Settings > Desktop Behavior. In there, open Desktop Effects. You should see Grayscale in the Appearance section. Toggle it a couple of times, and you'll see the grayscale effect at work.

Grayscale off:

Grayscale off

Grayscale on:

Grayscale on

Further configuration is possible. From the gitlab link:

A configuration file should be placed in /usr/share/kwin/effects/kwin4_effect_grayscale/contents/config/main.xml.

And available parameters are:

  • ApplyInactiveWindowsOnly (boolean) : Effect applies to inactive windows only if it's set true.

  • ExcludePanels (boolean) : Effect does not apply to panels if it's set true.

  • EffectStrength (integer): Effect strength by percentage (%).

DK Bose
  • 42,548
  • 23
  • 127
  • 221
  • Thanks a lot for this walk-through. For some reason, I had to change some of the rights, using chmod 755 /usr/share/kwin/effects/kwin4_effect_grayscale/ and then find /usr/share/kwin/effects/kwin4_effect_login/ -type d -exec chmod 755 {} +. – Clément Apr 17 '19 at 14:49