← Back to team overview

zim-wiki team mailing list archive

Re: Changing Zim pageview background color in Fedora 25

 

Found the problem.

The GTKRC color setting section in the Zim documentation (
http://zim-wiki.org/manual/Help/Config_Files.html) is sadly wrong (invalid
gtkrc format) (owner: please fix it, working example below)

FWIW This works under Fedora 25, and gives you a fully solarized (dark) zim
experience. Assumes that your gnome desktop is dark. Matches solarized
themes in gnome-terminal / geany / gedit


Create the files
   ~/.config/zim/gtkrc-mine
   ~/.config/zim/style.conf

with the contents below.

To run zim you can use:

env GTK2_RC_FILES=~/.config/zim/gtkrc-mine zim

You can edit your .desktop file to make things easier.

gedit admin:///usr/share/applications/zim.desktop

and then replace the "Exec" line with the line above, but replace '~' with
/home/your_username

For the new desktop file content to kick in in the app menu, log out and
log in of the shell. To test your desktop file, just navigate with nautilus
to /usr/share/applications and double click on the zim icon.

________________________________________


# gtkrc-mine   (~/.config/zim)
# gtk2 styling used for zim


# solarized reference: http://www.lispcast.com/solarized-cheat-sheet

style "mycolors"
{
  base[NORMAL]   = "#002b36"  # background in pageview
  base[SELECTED] = "#0f4d5c"  # background of text selection
  text[NORMAL]   = "#93a1a1"  # text color (from: geany solarized-dark)
  text[SELECTED] = "#93a1a1"
  text[PRELIGHT] = "#eee8d5"
}

widget "*.zim-pageview" style "mycolors"
widget "*.zim-pageindex" style "mycolors"
class "GtkWidget" style "mycolors"


___________________________________________


# style.conf: zim style template

# AR: solarized zim - use this style in conjunction with a custom gtkrc
#     Then run zim with:
#          env GTK2_RC_FILES=~/.config/zim/gtkrc-mine zim

#     Solarized color customizations below are per:
#       http://www.lispcast.com/solarized-cheat-sheet
#       and also from geany solarized-dark


[TextView]
bullet_icon_size=GTK_ICON_SIZE_MENU
indent=30
tabs=None
linespacing=3
font=
justify=

[Tag strong]
# bold text
# weight original: PANGO_WEIGHT_BOLD
weight=PANGO_WEIGHT_BOLD
foreground=#2aa198

[Tag emphasis]
# italic text
style=PANGO_STYLE_ITALIC

[Tag mark]
# highlighted text
foreground=#002b36
background=#b58900

[Tag strike]
foreground=grey
strikethrough=True

[Tag code]
#foreground=#2e3436
foreground=#93a1a1
scale=0.8
family=monospace

[Tag pre]
#foreground=#2e3436
foreground=#93a1a1
scale=0.8
indent=20
wrap-mode=GTK_WRAP_NONE
family=monospace

[Tag link]
#foreground=blue
foreground=#268bd2

[Tag tag]
foreground=#ce5c00

[Tag h1]
#foreground=#4e9a06
foreground=#859900
scale=1.75
underline=PANGO_UNDERLINE_SINGLE
weight=PANGO_WEIGHT_BOLD

[Tag h2]
#foreground=#4e9a06
foreground=#859900
scale=1.52
weight=PANGO_WEIGHT_BOLD

[Tag h3]
#foreground=#4e9a06
foreground=#859900
style=PANGO_STYLE_ITALIC
scale=1.32
weight=PANGO_WEIGHT_BOLD

[Tag h4]
#foreground=#4e9a06
foreground=#859900
scale=1.15
weight=PANGO_WEIGHT_BOLD

[Tag h5]
#foreground=#4e9a06
foreground=#859900
weight=PANGO_WEIGHT_BOLD

[Tag h6]
#foreground=#4e9a06
foreground=#859900