Use GTK-3.0 Dark variant theme for your GTK-2 terminal emulator

This is a workaround to force your preferred terminal emulator to use the Dark variant of Adwaita theme in GNOME >= 3.12 (maybe less, but untested).

Just add these lines to your ~/.bashrc file:

# set dark theme for xterm emulators
if [ "$TERM" == "xterm" ] ; then
 xprop -f _GTK_THEME_VARIANT 8u -set _GTK_THEME_VARIANT "dark" -id `xprop -root | awk '/^_NET_ACTIVE_WINDOW/ {print $5}'`
fi

This is how it works with Terminator:

Before

Before

After

After

8 thoughts on “Use GTK-3.0 Dark variant theme for your GTK-2 terminal emulator

  1. l3on Post author

    Not really.

    You can play with:

    xprop -f _GTK_THEME_VARIANT 8u -set _GTK_THEME_VARIANT dark
    

    and then select the Firefox window to set the dark theme.

    You can also pass to the command the -id option, specifying the window id used by Firefox, but I can’t find a simple way to get it …

    Reply
  2. Pingback: Leo Iannacone: Use GTK-3.0 Dark variant theme for your GTK-2 terminal emulator | Hi-tech news

    1. l3on Post author

      Interesting …

      Another simple way could be write a Gnome-Shell extension to connect the “window.on_create” (or whatever) to the xprop command…

      Or … patch directly Gnome-Shell ?

      Reply
  3. icewater

    …follow-up – I don’t suppose it’s possible to extend the dark theme to the tabs within terminator?

    Reply

Leave a Reply