Changing accessibility settings via terminal

Is it possible to change KDE Accessibility settings from terminal or a shell script? Overall I like the cursor shake feature, but I don’t always want it on
What I want to do:
-Execute a simple script that toggles the shake on and off
-Ideally, call the script when launching other applications (which I can do myself)

But I’m not sure where the config is stored for this feature in particular.

Hi - for what it’s worth, the setting for that appears to be stored in ~/.config/kwinrc. On my device, at least, turning it off writes a line to the [Plugins] section:

shakecursorEnabled=false

You might be able to use the kwriteconfig6 command from a script, similar to the approach discussed at the following link, to have that change be recognized and take effect immediately: Energymanagement via Console - #2 by johnandmegh

1 Like

Hm, I feel this is the write direction, but adding it (even through kwriteconfig6) to kwinrc doesn’t seem to be working. :\

EDIT
Weird. Adding it to the file DOES disable it via unchecking, but it doesn’t go into effect. Should I not use --notify? I’m unfamiliar with kwriteconfig6’s settings.

Hmm, maybe that wasn’t the right direction after all :sweat_smile: There might be a catch if KWin doesn’t read and write configuration information from that kwinrc file in the same way as other components - ex. perhaps it stores more in memory, as opposed to re-reading from disk?

Here’s another tactic that could be tried - sending a D-Bus signal to manually unload the “shakecursor” effect from KWin when it’s not desired, then reload it when it is. I tried the commands below on my device, and they had that intended effect - maybe they’ll be helpful for you?

Force-disable the effect:

$ qdbus-qt6 org.kde.KWin /Effects org.kde.kwin.Effects.unloadEffect shakecursor

Reload the effect:

$ qdbus-qt6 org.kde.KWin /Effects org.kde.kwin.Effects.loadEffect shakecursor
1 Like

I’m guessing it needs the QDBus command for KWin Reconfigure.

2 Likes

I actually tried to use reconfigure after changing the kwinrc – shakecursor was the only thing that didn’t update properly! Going to test John’s solution, though.

This worked and seems to be the solution, thank you.

1 Like