ghostty icon indicating copy to clipboard operation
ghostty copied to clipboard

GTK: Colored title bars depending on the theme

Open koaledu opened this issue 1 year ago • 5 comments

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: screenshot-2024-08-26-16-40-10

A mockup of what it could look like: screenshot-2024-08-26-16-41-57

koaledu avatar Aug 26 '24 16:08 koaledu

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

tristan957 avatar Sep 16 '24 20:09 tristan957

...which is the problem with the current ghostty config option, imo.

Which config option are you referring to?

ryleu avatar Jan 01 '25 16:01 ryleu

window-theme = ghostty. Now we have window-titlebar-{background,foreground} options, which help mitigate the fact that the colors blend together.

tristan957 avatar Jan 03 '25 01:01 tristan957

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

pluiedev avatar Mar 04 '25 09:03 pluiedev

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
Image Image

pluiedev avatar Mar 04 '25 10:03 pluiedev

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.

baarkerlounger avatar Sep 24 '25 15:09 baarkerlounger

While I personally love that feature as well, that's a separate feature request — please open a dedicated discussion for it for easier bookkeeping.

pluiedev avatar Sep 24 '25 15:09 pluiedev