sed -i '/[Document]/a ChangeColors=true' "$HOME/.var/app/org.kde.okular/config/okularpartrc" / sed -i '/ChangeColors=true/d' "$HOME/.var/app/org.kde.okular/config/okularpartrc" makes the change, but it is only read when Okular is started: it would be great if there were a way to update Okular on-the-fly, just like when the keyboard shortcut is used.
Similarly, sed -i '/DefaultProfile=Light.profile/DefaultProfile=Dark.profile' "$HOME/.config/konsolerc" / sed -i '/DefaultProfile=Dark.profile/DefaultProfile=Light.profile' "$HOME/.config/konsolerc" would be better changed to a command made for the task.
What would you recommend? Is D-Bus suitable for this?
I have been using [Yin-Yang(GitHub - oskarsh/Yin-Yang: Auto Nightmode for KDE, Gnome, Budgie, VSCode, Atom and more · GitHub) in the past although it doesn’t work for some things (Okular, VS Code) so I thought starting from scratch would be best.