gnunn1 / tilix

A tiling terminal emulator for Linux using GTK+ 3
https://gnunn1.github.io/tilix-web
Mozilla Public License 2.0
5.36k stars 293 forks source link

Follow system color-scheme preference #2165

Closed flaktack closed 8 months ago

flaktack commented 1 year ago

On recent GNOME releases, it is possible to set a system-wide light/dark mode preference. tilix does not update its theme-variant based on this value. (summary)

The preference is set in org.gnome.desktop.interface color-scheme and may be set to default / prefer-light / prefer-dark.

This PR modifies the existing theme-variant functionality so that

  1. if SETTINGS_THEME_VARIANT_KEY is set to system (default) and a color-scheme value is set then a dark variant is preferred if prefer-dark is set.
  2. whenever the system setting changes the them-variant preference is reapplied
  3. onThemChanged() is emitted for them-variant change so that terminal colors may be reapplied if SETTINGS_PROFILE_USE_THEME_COLORS_KEY is set.
ximion commented 8 months ago

That makes sense, thank you for the patch!