Flatseal icon indicating copy to clipboard operation
Flatseal copied to clipboard

Option to force Flatseal to use libadwaita dark theme?

Open laniakea64 opened this issue 1 year ago • 12 comments

With the latest Flatseal release switched to libadwaita, the dark libadwaita theme now makes Flatseal much easier on my eyes than the system preference of light theme. This is not the case for all libadwaita apps I use, so would prefer to avoid changing the global setting. And I couldn't find a general way for end user to set only one specific libadwaita app to use dark theme.

Could Flatseal please add the option to force itself to use the dark (or light) libadwaita theme, overriding the system preference?

BTW, a minor related issue: in dark theme, in the "Documentation" window, the horizontal scrollbar in the code box under "Use custom FLATPAK_USER_DIR" has weird white borders. Would it be possible to make that scrollbar look the same as the normal-looking vertical scrollbar in that same window?

Thanks - and thank you for Flatseal, it's a very nice and handy tool!

laniakea64 avatar Apr 28 '23 00:04 laniakea64

+1 It would be good to have an option to force some apps to a different dark/light mode for 2 reasons:

  1. The app only detects system dark/light mode preference so you need to switch it globally, but then your desktop doesn't look like you want.
  2. OS doesn't support dark/light mode preference

For reference maybe dconf or gsettings can be used for that: https://github.com/bottlesdevs/Bottles/issues/1758

Qronikarz avatar Apr 28 '23 13:04 Qronikarz

Dies setting GTK_THEME=Adwaita:dark still work with libadwaida?

rusty-snake avatar Apr 28 '23 16:04 rusty-snake

Dies setting GTK_THEME=Adwaita:dark still work with libadwaida?

In a way, but not well. Trying this with Flatseal, it does result in a dark theme, but breaks a lot of important styling - notably, everything is scrunched together, and some semantically meaningful coloring is lost, making the UI harder to parse.

laniakea64 avatar Apr 28 '23 17:04 laniakea64

Try ADW_DEBUG_COLOR_SCHEME=prefer-dark

80501 avatar Apr 28 '23 23:04 80501

Try ADW_DEBUG_COLOR_SCHEME=prefer-dark

Nice, thank you @80501 that works!

laniakea64 avatar Apr 29 '23 00:04 laniakea64

So, I had a similar problem: for consistency's sake, I use the adw-gtk3-dark theme, both system-wide and as a Flatpak.

Flatseal doesn't recognize it unless I pass ADW_DEBUG_COLOR_SCHEME=prefer-dark, as suggested by @80501 (thanks!).

The app seems to look primarily for the light variant, sticking with whatever it finds. However, as I don't have the light variant installed, it just falls back to the default Adwaita GTK3 theme.

Would be nice to have the app follow whatever is the current Flatpak theme you have installed.

Should I open a new issue for that or should it be discussed here?

Tuba2 avatar Apr 29 '23 02:04 Tuba2

@Tuba2 If you are not using GNOME desktop environment, try using dconf-editor to set /org/gnome/desktop/interface/color-scheme to prefer-dark if it isn't already. If that doesn't help you, please open a new issue for your case - IIUC this one is asking for the option of literally the opposite of what you're seeking :P

laniakea64 avatar Apr 29 '23 02:04 laniakea64

Yeah, I am using GNOME and 'prefer-dark' was already enabled. After I passed sudo flatpak override --env=ADW_DEBUG_COLOR_SCHEME=prefer-dark, it worked correctly.

However, I tried resetting the overrides and it now just works fine with the dark theme.

Maybe it was a bug with Flatpak environment variables. But it is weird because the issue was only with this app, and only after the recent update.

Anyway, I'll open an issue just to keep it on record and see if it happened to anyone else.

Thank you for your attention and for your great work on this app!

Tuba2 avatar Apr 29 '23 02:04 Tuba2

passed sudo flatpak override --env=ADW_DEBUG_COLOR_SCHEME=prefer-dark

Great idea, thank you @Tuba2 for the suggestion! So in a sense, Flatseal already has the option I'm seeking:

  1. in Flatseal's left pane that lists all installed flatpaks, select Flatseal

  2. under "Environment", add variable ADW_DEBUG_COLOR_SCHEME=prefer-dark

  3. Restart Flatseal.

:+1:

So that just leaves this -

BTW, a minor related issue: in dark theme, in the "Documentation" window, the horizontal scrollbar in the code box under "Use custom FLATPAK_USER_DIR" has weird white borders. Would it be possible to make that scrollbar look the same as the normal-looking vertical scrollbar in that same window?

laniakea64 avatar Apr 29 '23 03:04 laniakea64

Just applied @80501 's tip to a specific app. Glad it helped!

You might have to go sudo flatpak com.github.tchx84.Flatseal --env=ADW_DEBUG_COLOR_SCHEME=prefer-dark, though. When I tried to do it as a regular user, it said I didn't have enough permissions.

What a happy accident! 😄

Tuba2 avatar Apr 29 '23 03:04 Tuba2

it said I didn't have enough permissions.

Oft course, if you want to change something for all users it should require sudo. If you want to change it only for your user, pass --user after flatpak.

rusty-snake avatar Apr 29 '23 07:04 rusty-snake

Oft course, if you want to change something for all users it should require sudo. If you want to change it only for your user, pass --user after flatpak.

Oh, I see. Thanks for explaining!

I assumed whenever I applied Flatpak commands without sudo, it just worked for my user, so I thought the environment variables would work the same way.

Didn't even know about the --user flag. Nice to learn that 😄

Tuba2 avatar Apr 29 '23 16:04 Tuba2