gitk looks ugly / doesn't honor theme settings

gitk is implemented in tcl/tk. I've searched around but there doesn't seem to be much you can do; it is scolded as ugly on Linux everywhere. And apart from using a hideous toolkit, gitk has been growing worse for me as they put in more functions (mostly not used) the UI becomes even more confusing.

So I instead of a solution I recommend gitg, which is a similar tool, less mature, using GTK+.


tcl/tk 8.5 is actually themeable and looks rather native on Windows 7 and apparently on Mac. Less care seems to have been given to write theme engine bridges for it under linux, but you can do one of three things:

  • To get away from the "motif" look-and-feel to a slightly better one:

    $echo '*TkTheme: clam' | xrdb -merge -
    

To have it persist between reboots add the line *TkTheme: clam to ~/.Xresources, but I'm not sure if that's read whether you launch your desktop environment with startx or not.

  • Alternative solution to the above, by the author of the same blog post, on this very page: https://superuser.com/a/428563/107881

  • To get tk to use qt themes, you'll need to checkout and build tile-qt from: git://tktable.git.sourceforge.net/gitroot/tktable/tile-qt

Under Ubuntu 11.04 it was pretty easy, adapt the tcl/tk library paths as needed (some people have reported that those instructions are outdated):

$./configure --with-tcl=/usr/lib/tcl8.5/ --with-tk=/usr/lib/tk8.5/

$make

$sudo checkinstall

checkinstall being for creating a quick .deb instead of installing directly, keeps the system tidy.

Then afterwards as above, get tk to use your qt themes:

$echo '*TkTheme: tileqt' | xrdb -merge -
  • There's also a tile-gtk in the same sourceforge repo as tile-qt, but it's thouroughly out-of date. I did manage to build it and install it after much fiddling but the visual results were messy - not recommended.

To fix this the Debian (Ubuntu) way:

$ sudo apt-get install tk8.5
$ sudo update-alternatives --config wish

And then pick the wish8.5 alternative.