GTK: Colored title bars depending on the theme
In GTK, the title bar color depends on the Libadwaita light/dark setting. This could look out of place in some themes. It would be great to have a setting to automatically set colors for the title bar that fit better with the theme. And it would fit very nicely with the new Libadwaita PR.
Ptyxis is another GTK+Libadwaita terminal and does this quite nicely:
A mockup of what it could look like:
I found the code in ptyxis which shades the background color so the titlebar doesn't run into the the background of the terminal, which is the problem with the current ghostty config option, imo.
https://gitlab.gnome.org/chergert/ptyxis/-/blob/main/src/ptyxis-palette.c#L328-331
...which is the problem with the current
ghosttyconfig option, imo.
Which config option are you referring to?
window-theme = ghostty. Now we have window-titlebar-{background,foreground} options, which help mitigate the fact that the colors blend together.
I took a brief look at Ptyxis's source code and it looks like they're doing color math in code...? That sounds a bit overkill. window-theme=ghostty already works by custom CSS injection and we can just do color math there
Somewhat interestingly, looks like Ptyxis only meaningfully changes the headerbar color in dark mode? Maybe it's a thing with specific themes...
| Catppuccin Latte | Catppuccin Mocha |
|---|---|
Ptyxis also changes the headerbar colour when running as sudo (red) or when SSHing which is really helpful as a visual indicator (Gnome Console also does this). Would be really helpful to have that on Ghostty also.
While I personally love that feature as well, that's a separate feature request — please open a dedicated discussion for it for easier bookkeeping.