kwin-grayscale-effect icon indicating copy to clipboard operation
kwin-grayscale-effect copied to clipboard

bind is not possible

Open fedorovenskiy opened this issue 6 years ago • 6 comments

it is not possible to bind this effect, and this is very important to not open system settings every time I need to disable|enable this function

fedorovenskiy avatar Sep 06 '19 19:09 fedorovenskiy

https://github.com/murat-cileli/kwin-grayscale-effect/issues/2#issue-490497040

@fedorovenskiy, what does binding refer to in this context?

RokeJulianLockhart avatar Feb 19 '22 17:02 RokeJulianLockhart

@BEEDELLROKEJULIANLOCKHART, I suppose it means that you can login, and the effect will be active right from the start. But I don't yet know how to do that.

gearcoded avatar May 09 '22 18:05 gearcoded

here's a solution If what you mean by bind is a way to toggle the effect through a keyboard shortcut. i'm on kde 5.27.5. the terminal command for toggling it. qdbus org.kde.KWin.Effect.WindowView1 /Effects org.kde.kwin.Effects.toggleEffect kwin4_effect_grayscale

  1. Go here and click Command/url Screenshot_20230716_185209
  2. Copy qdbus org.kde.KWin.Effect.WindowView1 /Effects org.kde.kwin.Effects.toggleEffect kwin4_effect_grayscale in the Action tab and on the Trigger tab add your shortcut key.

RomanMunar avatar Jul 16 '23 10:07 RomanMunar

here's a solution

I was looking for this answer in theory, but that command returned Cannot find 'org.kde.kwin.Effects.toggleEffect' in object /Effects at org.kde.KWin.Effect.WindowView1 for me.

Here's what worked for me:

  • Create a filename.sh with the following code:
#!/bin/bash
greyscaleEnabled=$(kreadconfig5 --file ~/.config/kwinrc --group Plugins --key kwin4_effect_grayscaleEnabled)
kwriteconfig5 --file ~/.config/kwinrc --group Plugins --key kwin4_effect_grayscaleEnabled $((!$greyscaleEnabled))
sleep 0.2
qdbus org.kde.KWin /Compositor suspend
qdbus org.kde.KWin /Compositor resume
  • Put sh path/to/filename.sh in the Action tab mentioned above

Thank you to @RomanMunar and to iceman7789 from the comments at the KDE Store for helping me get to a solution that worked with my setup!

kaBeech avatar Jan 03 '24 05:01 kaBeech

Yeah would add that I had installed mine manually(instruction on README) and not from the KDE store 👍️

RomanMunar avatar Jan 03 '24 08:01 RomanMunar

Yeah would add that I had installed mine manually(instruction on README) and not from the KDE store 👍️

Oh yeah, me too. I only found out that it was on the KDE Store when I was searching for shortcut solutions. I think it should work either way though.

kaBeech avatar Jan 03 '24 08:01 kaBeech