nwg-piotr / nwg-drawer

Application drawer for wlroots-based Wayland compositors
MIT License
240 stars 25 forks source link

Support for changing GTK theme #58

Closed jovanlanik closed 2 years ago

jovanlanik commented 2 years ago

This pull request adds an argument to change the GTK theme. Unlike changing the theme with environment variables or gsettings, the change doesn't effect other applications. I added the same functionality to nwg-launchers (nwg-piotr/nwg-launchers#200) but now I use sway with nwg-drawer and would like to see it merged here. It's my first time working in go, I hope the code is ok. I tested this on sway for 4 days and had no issues.

nwg-piotr commented 2 years ago

Interesting. Could you tell me more about the use case? Personally I see no use on my machine, but it could be merged immediately, even if not yet released. I can't make my mind if to accept two other pending PRs, or to reject them.

jovanlanik commented 2 years ago

Well, my use case is that I want nwg-drawer to always use Adwaita-dark regardless of gsettings, but I want other apps (including those that are launched by nwg-drawer) to respect gsettings. I can't use the GTK_THEME environmental variable because it affects launched apps. I can also see use on systems which have automatic dark theme switching. If you have custom css for nwg-drawer it's probably based around one theme, so you'd want to prevent automatic switching by ignoring gsettings and always use the right theme.

nwg-piotr commented 2 years ago

Perfect explanation, thanks!

jovanlanik commented 2 years ago

@nwg-piotr Thank you for merging. Would you be open to adding the same feature to other nwg-shell programs? I think the same reasoning applies.

nwg-piotr commented 2 years ago

Yes, good idea.