Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to force Flatseal to use libadwaita dark theme? #535

Open
laniakea64 opened this issue Apr 28, 2023 · 12 comments
Open

Option to force Flatseal to use libadwaita dark theme? #535

laniakea64 opened this issue Apr 28, 2023 · 12 comments

Comments

@laniakea64
Copy link

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!

@Qronikarz
Copy link

+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: bottlesdevs/Bottles#1758

@rusty-snake
Copy link

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

@laniakea64
Copy link
Author

laniakea64 commented Apr 28, 2023

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.

@80501
Copy link

80501 commented Apr 28, 2023

Try ADW_DEBUG_COLOR_SCHEME=prefer-dark

@laniakea64
Copy link
Author

Try ADW_DEBUG_COLOR_SCHEME=prefer-dark

Nice, thank you @80501 that works!

@Tuba2
Copy link

Tuba2 commented Apr 29, 2023

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?

@laniakea64
Copy link
Author

laniakea64 commented Apr 29, 2023

@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

@Tuba2
Copy link

Tuba2 commented Apr 29, 2023

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!

@laniakea64
Copy link
Author

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.

👍

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?

@Tuba2
Copy link

Tuba2 commented Apr 29, 2023

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! 😄

@rusty-snake
Copy link

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.

@Tuba2
Copy link

Tuba2 commented Apr 29, 2023

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 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants