A hack solution is to edit ~/.gtkrc-2.0
, wait until the application starts and edit the file again.
You can automate it.
Assuming Adwaita
is your default theme and that you want to switch to Clearlooks-Zenburn
, write a script called darkgtk2start
and make it executable with chmod +x filename
:
sed -i 's/gtk-theme-name="Adwaita"/gtk-theme-name="Clearlooks-Zenburn"/' ~/.gtkrc-2.0
"$@"
sleep 1
sed -i 's/gtk-theme-name="Clearlooks-Zenburn"/gtk-theme-name="Adwaita"/' ~/.gtkrc-2.0
Now you can start gvim dark by running:
./darkgtk2start gvim
If you move the script to a location in your PATH
(.local/bin/
is a common one) you don't have to use ./
any more and you can replace the gvim
command by adding the following line to ~/.bashrc
:
alias gvim='darkgtk2start gvim'