Skip to content

Set a dark theme and background

Gonzalo P.A. edited this page Aug 23, 2024 · 10 revisions

See the Theme manager Plugin which helps you do this via a nice gui.

Does not work for new Versions (e.g. 0.75.1). See instructions below


The background colour of the main text window is set by the GTK theme.

Instructions for Windows Portable edition

Everything is easiest with windows Portable edition because all the files are contained in the Zim folder.

You need to know wich gtk version your Zim is using. Newer Versions (e.g. 0.75.1) use GTK3.

For GTK3

  1. First download a gtk3.0 theme. I will use Orchis-Pink-Dark as an example here (available within the Orchis gtk theme).
  2. Put extracted theme folder into ...\App\ZimDesktopWiki\share\themes.
  3. Create the file and directories ...\App\ZimDesktopWiki\etc\gtk-3.0\settings.ini.
  4. Insert following text in the settings.ini:
[Settings]
gtk-theme-name = Orchis-Pink-Dark

If you have chosen another theme, replace Orchis-Pink-Dark with the name of the extracted folder.

  1. Restart Zim

For GTK2 (Older Zim Versions)

First download a suitable dark background (or whatever colour you want) theme. Any GTK 2.x theme should work, I used Nodoka-Midnight. That is a good webiste for getting themes.

Put extract the theme folder into ...\App\ZimDesktopWiki\share\themes.

Now navigate to ...\App\ZimDesktopWiki\etc\gtk-2.0 and open gtkrc with notepad or any editor. Edit it so that it contains your theme's name. In my case it was gtk-theme-name = "Nodoka-Midnight.

Now open Zim and it will be fully themed, almost; you might want to change some of the formatting text colours (see further down this page).

Instructions for Normal Windows Installation

Same as above, but now the gtkrc is in your home folder, not in the zim portable folder.

If installed to C:\Program Files (x86)\Zim Desktop Wiki, you may have to adjust permissions because Windows tries to protect things under the Program Files directories.

  • Extract the theme to C:\Program Files (x86)\Zim Desktop Wiki\share\themes (Give administrative permission) The directory listing should now look like:

    Default Emacs MS-Windows Nodoka-Midnight Raleigh

For GTK3

  1. Create the file and directories C:\Program Files (x86)\ZimDesktopWiki\etc\gtk-3.0\settings.ini.
  2. Give yourself permission to edit the settings.ini file.
  3. Insert following text in the settings.ini:
[Settings]
gtk-theme-name = Orchis-Pink-Dark

If you have chosen another theme, replace Orchis-Pink-Dark with the name of the extracted folder.

  1. Restart Zim

For GTK2 (Older Zim Versions)

  • Give yourself permission to edit the gtkrc file:
    • Right-click C:\Program Files (x86)\Zim Desktop Wiki\etc\gtk-2.0\gtkrc and select Properties
    • Uncheck 'Read-only' if it is checked
    • On the security tab, click "Edit...", then click "Add...", type your Windows login name and click "Check Names", then "OK"
    • Check "Full control" and okay out of the dialogs
  • Edit the gtkrc file to use the name of the directory that you extracted the theme to, ex:

gtk-theme-name = "Nodoka-Midnight"

  • Save gtkrc and restart Zim

Instructions for Windows (installed from source)

  • If zim is run from the source code, these files may need to reside in a different location, due to the dependence on the local installation of the PyGTK runtime. On my system, these locations were:

     C:\Python\Lib\site-packages\gtk-2.16.6\share\themes
     C:\Python\Lib\site-packages\gtk-2.16.6\etc\gtk-2.0
    
  • On another Windows installation, these locations were found in:

     C:\Python27-win32\Lib\site-packages\gtk-2.0\runtime\share\themes
     C:\Python27-win32\Lib\site-packages\gtk-2.0\runtime\etc\gtk-2.0
    
  • Placing the Nodoka-Midnight folder and gtkrc file in those folders got the dark theme working for me with zim 0.63

Changing the text colours

To change the formatted text colours you need to edit style.conf, which is located in ...\Data\Config\zim\style.conf for a portable installation (it might not exist by default, see the zim manual). All the instructions are already in the Zim manual http://zim-wiki.org/manual/Help/Config_Files.html .

Clone this wiki locally