glow icon indicating copy to clipboard operation
glow copied to clipboard

Switching system themes in GNOME does not update color scheme

Open Siilwyn opened this issue 4 years ago • 4 comments

When switching between a light and dark theme on GNOME (Fedora 33), the Glow colour scheme except from the background does not update. This issue has been around since v1.0.0, (love using Glow!) always thought it was a terminal bug however I recently noticed that this bug is not present in another TUI (dijo). The colours persist even when navigating between files in Glow.

Screenshots to clarify:

Light theme

Screenshot from 2021-03-27 11-00-49

Dark theme, switched while glow is open

Screenshot from 2021-03-27 11-01-12

Dark theme

Screenshot from 2021-03-27 11-01-39

Reproduce

  1. Use light theme: /usr/bin/gsettings set org.gnome.desktop.interface gtk-theme Adwaita.
  2. Open glow.
  3. Use dark theme: /usr/bin/gsettings set org.gnome.desktop.interface gtk-theme Adwaita-dark.
  4. See colours in Glow not updating.

Siilwyn avatar Mar 27 '21 10:03 Siilwyn

Are you talking about switching the theme while glow is running? The theme is only checked on startup (at least currently).

muesli avatar Mar 27 '21 10:03 muesli

@muesli Yes exactly. It might seem like an edge case however I believe this is going to be more common once more distros start using automatic light/dark theme settings like Elementary OS is doing.

Siilwyn avatar Mar 27 '21 10:03 Siilwyn

Quick update:

While not impossible, this might be really tricky to support. We'd have to periodically query the terminal for its current color settings, which - depending on the terminal you're using - can be a time-intensive query. Mind you, we're talking milliseconds, but it's probably not something you'd want to query once per second. I have to do some more tests and benchmarks with various terminals.

muesli avatar Oct 12 '22 00:10 muesli

I get that, I hope that somewhere down the line terminals would signal a desktop color scheme change... :crossed_fingers:

Coincidentally I've recently looked at supporting color scheme changes in a cli app daemon and working on adding that by listening to the freedesktop portal color-scheme value over d-bus. Maybe that's also an option here?

Siilwyn avatar Oct 13 '22 12:10 Siilwyn