Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of making the GTK widgets dark in Geany without changing the whole environment

It turns out you can have separate GTK rc files for separate apps, just by setting an environment variable. For this example I'm using this theme: https://github.com/axxapy/Adwaita-dark-gtk2

First, clone the GTK theme you want into a directory such as ~/.config/geany/gtk

mkdir ~/.config/geany/gtk2/
cd ~/.config/geany/gtk2/
git clone git@github.com:axxapy/Adwaita-dark-gtk2.git

That's it. You only have to do that part once. Now any time you run geany, just set an environment variable first, like so:

GTK2_RC_FILES=~/.config/geany/gtk2/Adwaita-dark-gtk2/gtk-2.0/gtkrc geany

Or if you use a menu to launch programs, use the command like this:

bash -c 'GTK2_RC_FILES=~/.config/geany/gtk2/Adwaita-dark-gtk2/gtk-2.0/gtkrc geany %F'

NOTE: This theme has a dark scrollbar that's hard to see in Geany. So to fix this, open the above mentioned gtkrc file and find this section:

# Scrollbar
style "murrine-scrollbar" = "murrine-wider" {
 bg[NORMAL] = shade (.65, @bg_color)
 bg[PRELIGHT] = @selected_bg_color
 bg[ACTIVE] = @selected_bg_color

and replace the second line with this:

 bg[NORMAL] = @selected_bg_color

or some other color value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment