Brno Hat

Jiri Eischmann's Blog

Dark title bars for apps with dark UI

I really like the polished look of GNOME and its default theme Adwaita, but there is one thing that has been bugging me for some time. By default server side window decorations are light and if an app has a dark UI and uses a server side window decorations, you get a dark window with a light title bar. It doesn’t look every nice and when you maximize the window, it’ll get even worse because you get a nice black-and-white hamburger (black top bar, light title bar, and dark window content).

There are quite a few apps suffering from this: Atom, Firefox Developer Edition, Blender,…

But Mutter actually allows the clients to set a theme for their window decorations even though they’re rendered on the server side. They just need to set an x window property GTK_THEME_VARIANT=dark.

And I think the difference speaks for itself:

snimek-z-2017-01-10-18-55-41

snimek-z-2017-01-10-16-52-05

You can test it by executing: xprop -f _GTK_THEME_VARIANT 8u -set _GTK_THEME_VARIANT dark

and clicking the window where it should apply.

Are you a user of one of the apps that would benefit from it? Or even a contributor? Try to convince the project to implement this tiny change. If you’re a distro maintainer of such an app, you may consider applying a small patch.

13 responses to “Dark title bars for apps with dark UI”

  1. Mathieu Bridon Avatar

    I suppose setting this X property won’t work in Wayland? What’s the solution there, then?

    1. eischmann Avatar

      It does work on Wayland. I’m running on Wayland and can change the decoration theme via the x window property.

      1. Emmanuele Bassi Avatar

        Only for X11 applications using XWayland.

        1. eischmann Avatar

          Yes, it only works on XWayland, but right now it’s solely an issue of X applications. All native Wayland apps I’ve seen so far have a client-side decorations. We’ll see how it’s gonna work with KDE apps since they still intend to have server-side decorations even on Wayland.

  2. mauge Avatar

    really nice, an small bash file could be created to start the application and set it using window name 😉

    #! /bin/bash
    ./blender &
    sleep 1
    xprop -f _GTK_THEME_VARIANT 8u -set _GTK_THEME_VARIANT dark -name “Blender”

  3. Marek Avatar
    Marek

    what is the difference between setting the X property and setting Global Dark Theme option in Gnome Tweak Tool?

    1. eischmann Avatar

      With x property, it can be done per application. I still want to use the light version of Adwaita by default, I just want dark decorations for apps that have a dark UI.

  4. Nacho Avatar
    Nacho

    If the application itself knows it is using a dark theme, setting this property should be done by the application.

    1. ilya Avatar
      ilya

      there is plugin for atom gtk-dark-theme https://atom.io/packages/gtk-dark-theme

  5. João Paulo Avatar

    How I start Spotify with dark windows?

  6. Juani Avatar
    Juani

    I love you!!!!!!! Thanks for this

Leave a Reply

Your email address will not be published. Required fields are marked *