Skip to content

Instantly share code, notes, and snippets.

@jcbrinfo
Last active June 6, 2021 18:46
Show Gist options
  • Save jcbrinfo/eec7aa39d6006e68085aac8c91abb891 to your computer and use it in GitHub Desktop.
Save jcbrinfo/eec7aa39d6006e68085aac8c91abb891 to your computer and use it in GitHub Desktop.
How to set the Ttk theme

How to set the theme of a Ttk application on Linux

Ttk applications like git-gui and gitk look ugly by default on Linux because the default Ttk tries to emulate Motif. Here is how to make them less ugly.

  1. Choose a Ttk theme. A partial list is provided by the official wiki of TCL.

  2. If the chosen a theme that is not built-in:

    1. If not already done, create a directory dedicated to Ttk themes. Example: mkdir ~/.local/share/tk-themes
    2. Put the theme’s directory (there should be a pkgIndex.tcl file at its root) in it. For example, if we want the Clearlooks theme, we copy the content of the themes/clearlooks directory of the “Ttk themes” project (see the link above) in ~/.local/share/tk-themes/clearlooks
    3. If not already done, add the line export TCLLIBPATH=<directory> (where <directory> is the path to the directory where you put your Ttk themes) to your ~/.profile file (or whatever the script that executes when you log in). Example: echo 'export TCLLIBPATH="${HOME}/.local/share/tk-themes"' >> ~/.profile
  3. Set *TkTheme to your chosen theme in your ~/.Xresources file. Example of configuration line:

    *TkTheme: clearlooks
    
  4. Restart your X session or run xrdb -merge ~/.Xresources && source ~/.profile

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