Skip to content

Instantly share code, notes, and snippets.

@jeffcogswell
Last active November 4, 2021 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jeffcogswell/95a1946fa45c43227e97ad5662ce5c0b to your computer and use it in GitHub Desktop.
Save jeffcogswell/95a1946fa45c43227e97ad5662ce5c0b to your computer and use it in GitHub Desktop.
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