I think the tool you are looking for is kwriteconfig. I am not sure how to use it but it seems like it can do what you want.
Linux Questions
Linux questions Rules (in addition of the Lemmy.zip rules)
- stay on topic
- be nice (no name calling)
- do not post long blocks of text such as logs
- do not delete your posts
- only post questions (no information posts)
Tips for giving and receiving help
- be as clear and specific
- say thank you if a solution works
- verify your solutions before posting them as facts.
Any rule violations will result in disciplinary actions
Thanks to your hint I did some tinkering.
Made a backup of my kwinrc
file, enabled the effect plugin, checked the diff
between the backup and the now-changed-by-the-settings-gui file -- And indeed there it was, a line saying colorblindnesscorrectionEnabled=true
in there.
However:
kwriteconfig
seemingly doesn't work like I thought it did, as just doingkwriteconfig6 colorblindesscorrectionEnabled false
does nothing -- This, I imagine, is just me not knowing how to work the command itself.
But ALSO!
- Manually editing the rc file to remove/change that line in a text editor did not remove the effect, HOWEVER, upon opening the settings gui app, the checkbox for the plugin was unchecked (requiring me to check and uncheck and apply to disable it proper) -- Which tells me that "editing the file might work but I'd have to run some command to reload the configs and make it go through" -- I did however try
qdbus org.kde.KWin /KWin reconfigure
(after searching "how to reload kde configs from terminal") and it did nothing, so that is NOT the command I need.
Overall promising discoveries, hoping someone can see this and give me the clue I need to make it work.
EDIT: I FOUND IT!
Well good luck finding an answer. Just remember to keep this post updated.
Just did, posted a comment explaining it, will update the main post to mark it solved
I figured it out. After another comment mentioned qdbus
, I realised I had qdbusviewer
, so I ran that and fucked around in it looking at the services and methods from them and trial-and-erroring for a bit
And I found the command I needed to make it happen. It's a single command too, no need for scripts:
It's: qdbus6 org.kde.KWin /Effects toggleEffect colorblindnesscorrection
It was under Effects
rather than Plugins
I'm not on Plasma 6 yet, so I can't tell you exactly what to run, but you can find out yourself.
First, figure out what needs to be changed in the config files.
To do so, you can run git init
in ~/.config
. Then run git add .
in there.
Now change the setting you want to change in the UI.
And now run git diff
to see what changed.
I'll use enabling the Wobbly Windows effect as an example.
So, my diff looks like this:
[Plugins]
...
+ wobblywindowsEnabled=true
(The wobblywindows-line got added into the Plugins
group.)
Now you can switch off Wobbly Windows in the UI settings and then use these commands (with the appropriate parameters in kwriteconfig5
) to switch it on again, and tell KWin to load the new settings:
kwriteconfig5 --file ~/.config/kwinrc --group Plugins --key wobblywindowsEnabled true
qdbus-qt5 org.kde.KWin /KWin reconfigure
Presumably, those "5"s need to be "6"s on Plasma 6.
You can also check git diff
again to see whether it changes the config file correctly.
To actually toggle the value, you'll have to write a script. You can use kreadconfig to read out the current value:
kreadconfig5 --file ~/.config/kwinrc --group Plugins --key wobblywindowsEnabled
Make sure, you clean up the Git repo we created in your ~/.config
folder once you're done:
rm -rf ~/.config/.git/
I am thankful for you explaining how to ACTUALLY work with kwriteconfig
. It did work with kwriteconfig6 --file ~/.config/kwinrc --group Plugins --key colorblindnesscorrectionEnabled false
in that the file changed the way I expected it to.
BUT
While the command does work for changing the configuration on the file -- the qdbus command to reload it doesn't seem to work.
EDIT: I FOUND IT!
See my post (assuming that's already up, am writing it) if you care about the details