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:
nice. is there a similar easy way to get the dark mode for firefox?
Not really.
You can play with:
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 …Pingback: Leo Iannacone: Use GTK-3.0 Dark variant theme for your GTK-2 terminal emulator | Hi-tech news
A nice way to do this automatically would be using devilspie2 (www.gusnan.se/devilspie2/
): it can match window properties and run actions when they show up, using Lua. This, for example, is what I use to change the class name of some Wine programs, but it can be easily adapted to run any other command:
https://gist.github.com/danielkza/b4ef8fcfa8626364d9ca
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 ?
Exactly what I needed to complete my switch from gnome-terminal. Thanks.
…follow-up – I don’t suppose it’s possible to extend the dark theme to the tabs within terminator?
Well, actually I do not know 🙂