oskarsh / Yin-Yang

Auto Nightmode for KDE, Gnome, Budgie, VSCode, Atom and more
MIT License
635 stars 52 forks source link

IDEA Execute script on switch #126

Closed Peter-Ries closed 2 years ago

Peter-Ries commented 2 years ago

Hi and thanks for this cool script!

I use KDE and switching between dark and light mode works. Only thing is that I'd like to use the BreezeClassic colorscheme when light mode is enabled. The regular light mode uses Breeze.

If I could provide a script for dark and light, I could do very individual things you cannot do as you are supporting other DE as well.

I then could execute a "plasma5-apply-colortheme BreezeClassic" when switching to light mode. May be I even could find a "sed ..." command to switch konsole colorscheme.

Just an idea... Hope you consider it useful.

l0drex commented 2 years ago

Support for KDE color schemes is coming in #107.

For custom scripts, you could listen to changes of the color-scheme preference in the xdg desktop settings (via dbus). This works on newer plasma releases. For the future, it would be definitely nice to allow custom scripts directly by the application.

If you have found a way to change konsole color schemes, feel free to share it by creating a pull request. There is some documentation about it in the wiki. You should probably wait for #68 before you start working on it, I did some changes to the plugin system.

oskarsh commented 2 years ago

@l0drex I think generally it would be a nice to provide light.sh and dark.sh just 2 default scripts that always get executed when the respected theme changes. This feature got requested multiple times and I think this would be the most UX friendly option. Basically it saves the client from adding any python code and just have a .sh script to deal with. wdyt?

l0drex commented 2 years ago

Yeah, that's the idea I also came up with. It's quite easy to implement, and I actually have written a plugin (not yet tested) over here.

You basically provide scripts for light and dark mode. However, I would like to support providing arguments to them, so you could reuse the same script and just change arguments.