qarmin / czkawka

Multi functional app to find duplicates, empty folders, similar images etc.
Other
18.38k stars 606 forks source link

Feature Request: Dark theme #1055

Open gimplyworxs opened 10 months ago

gimplyworxs commented 10 months ago

I use this programme as a flatpak. It would be really nice and helpful if it came shipped with a dark theme, too. Getting flatpaks to use dark theme ( as everything else on my system) doesn't work here.

alexislefebvre commented 9 months ago

Does the dark theme work if you use the Linux binary? https://github.com/qarmin/czkawka/blob/master/instructions/Installation.md#precompiled-binaries

gimplyworxs commented 9 months ago

Doesn't work as a binary because of gtk4 I guess The message I get is this: ./linux_czkawka_gui: error while loading shared libraries: libgtk-4.so.1: cannot open shared object file: No such file or directory

So I have to use the flatpak

PS.: I'm on Linux Mint 20.1 MATE

alexislefebvre commented 9 months ago

Can you temporarily install libgtk-4 and try the binary? If the dark theme works, then it means that there may be an issue with flatpak and not with the app itself.

gimplyworxs commented 9 months ago

libgtk-4 is not available for my system. To what I observed, dark themes on flatpak work for gtk-3 and under. Apps that use gtk-4 stay light, which is a pity. I have everything as a dark theme because of old-age's eyesight.

gimplyworxs commented 9 months ago

Tried on a Mint 21.2 Virtualbox which has gtk-4 in its repos. Can confirm that dark mode works there with the binary. But I'm not on such a system, therefore have to stay with flatpak. I read a lot about libadwaita for gtk4 stuff ... maybe that's the key to the solution.

Qronikarz commented 8 months ago

I'm on Mint 21.2 where Libadwaita apps do detect dark theme, but Czkawka isn't. Here's more info: https://github.com/qarmin/czkawka/issues/812 Somebody there wrote the workaround which you can try, but it would be nice to have it in Czkawka without any hacks.

gimplyworxs commented 8 months ago

Finally found how it works in flatpak with gtk4 apps: Install adwaita dark theme like so:

flatpak install flathub org.gtk.Gtk3theme.Adwaita-dark

And run the app like so: /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=czkawka_gui --env=GTK_THEME=Adwaita-dark com.github.qarmin.czkawka

elsiehupp commented 1 week ago

Following the instructions from this Reddit thread, one can add @gimplyworxs's environmental variable for all Flatpak apps (particularly if you are running elementary OS):

  1. Install Flatseal from Flathub.
  2. Open Flatseal and click "All Applications" in the top left corner.
  3. Scroll down to "Environment" and click "+" to add a new variable.
  4. Paste GTK_THEME=Adwaita:dark into the new variable and click elsewhere. (The variable will be automatically applied, as there is no "Apply" button.)

Adwaita applications that expect a GTK_THEME environment variable will now use Adwaita-Dark.

As a bonus, if you install qt5ct and use Flatseal to set the environment variable QT_QPA_PLATFORMTHEME=qt5ct, you should be able to set a mostly harmonious dark theme in Qt applications, too, though I haven't gotten this to work with Nextcloud Desktop just yet...