danth / stylix

System-wide colorscheming and typography for NixOS
https://stylix.danth.me/
MIT License
904 stars 105 forks source link

kde: apply Qt theme on non-KDE systems #367

Open Jackaed opened 1 month ago

Jackaed commented 1 month ago

Fixes plasma theme not applying on non-KDE desktop environments and on window managers. See #142.

danth commented 1 month ago

Here's Dolphin, fully themed under GNOME:

Screenshot of Dolphin

The missing file previews are because I didn't install the thumbnail service, nothing to do with this PR.

I didn't have much luck getting this to work with non-KDE Qt apps. Is it meant to theme those too?

Jackaed commented 1 month ago

It worked with PCManFM-Qt when I tried it, so it works with some. What apps was it not working for?

danth commented 1 month ago

You're right, it works straight away with PCManFM. I just tried some XFCE apps and they work, too.

I was trying it with KeepassXC before, which does include its own theming menu, so it may just be that KeepassXC is doing its own thing even when I set it to use the system theme.

Jackaed commented 1 month ago

If you set keepassxc to use the "Classic (platform native)" theme it should follow your system theme

danth commented 1 month ago

I tried that, but it kept a default white theme for some reason.

danth commented 1 month ago

Side note: This PR adds around 250 MiB downloaded and 800 MiB unpacked on a GNOME system, due to the dependency on plasma-workspace. Although it's not small, I think that's a reasonable price to pay for consistent theming across a number of different apps.

Jackaed commented 1 month ago

I tried that, but it kept a default white theme for some reason.

Interesting - works fine on my machine. I think there'll always be some strange edge cases with how weird Qt theming is in general - probably best to deal with these cases as they come up.

Jackaed commented 1 month ago

Side note: This PR adds around 250 MiB downloaded and 800 MiB unpacked on a GNOME system, due to the dependency on plasma-workspace. Although it's not small, I think that's a reasonable price to pay for consistent theming across a number of different apps.

We could try and remove the plasma-workspace dependency if it becomes a problem that people complain about by trying to write to kdeglobals directly, but I doubt it'll be an issue.

Jackaed commented 1 month ago

In it's current iteration, this PR doesn't seem to work if home-manager.useUserPackages = true is set. Not sure why, will look into it when I have time.

Jackaed commented 1 month ago

I've edited the PR to replace the dependency on plasma-workspace with just directly writing to kdeglobals instead.

niksingh710 commented 2 days ago

plasma-workspace taking 800 Mib. It should not be an issue but using kvantum (kvconfig) and qt5ct/qt6ct themes templates to generate and set them.

My Templates does contain a lot of pywal based templates but they are not in moustache format (they are in somthing similar). Rn m in mid of transition Arch->Nix porting them is not possible rn for me.