Zim - a desktop Wiki

:seedling: This how-to guide provides an easy and secure setup of Zim in Qubes OS.

What is Zim ?

In a nutshell, Zim - a notebook application - can be used to:

  • Keep an archive of notes
  • Keep a daily or weekly journal
  • Take notes during meetings or lectures
  • Organize task lists
  • Draft blog entries and emails
  • Do brainstorming
  • a special usage for Qubes OS

Use Zim as offline bookmark manager (special usage for Qubes OS)

The idea, instead of using a persistent web-browser or a complex split-browser setup to store your bookmarks, you are using Zim to manage your bookmarks.

How does it work?
The Zim notebook should be placed into an offline qube and all hyperlink should open a disposable qube as default. The Qubes OS default setting will ask for an user confirmation to open it in dispxxxx, alternatively you can set the default i.e. to whonix-workstation. This configuration requires modification of Qubes OS RPC policies. Further information can be found in the Qubes OS Documentation.


RPC policy example

In dom0:

nano /etc/qubes/policy.d/10-user-open-url-and-file-in-dvm.policy
qubes.OpenInVM * @anyvm @dispvm ask default_target=default-vm
qubes.OpenURL * @anyvm @dispvm ask default_target=default-vm

Obviously, this simple setup comes with the downside, that you have no login or password auto-fill feature for your favorite bookmarks.


Remark:
To keep things minimal and avoid messing up your default templates, we are going to use a Debian minimal template as a baseline (the ‘deb-12-m-zim’ will be a clone of it).

1. Create zim qubes

Open a dom0 terminal:

dxy=$(qvm-template list --available | grep -Eo "debian.*minimal" | tail -n 1 | grep -Eo "[0-9]+")
src="debian-${dxy}-minimal"
tpl="deb-${dxy}-m-zim"
app="zim"
qvm-template install ${src}
qvm-clone ${src} ${tpl}
qvm-create ${app} --template ${tpl} --label green
qvm-prefs ${app} netvm none

2. Install zim software packages

open the deb- * -m-zim (template) terminal from the dom0 terminal:

qvm-run --pass-io --user root ${tpl} xterm

afterwards, in the deb- * -m-zim terminal:

apt update && apt upgrade --yes
apt install --no-install-recommends qubes-core-agent-passwordless-root qubes-core-agent-nautilus nautilus gnome-terminal zim --yes
exit

3. Some additional tuning and configuration

There is a desktop icon tray which can be use to autostart Zim silently on boot.

open the zim (appVM) terminal:

nano  ~/.config/autostart/zim-desktop-tray
[Desktop Entry]
Type=Application
Name=zim-trayicon
Exec=zim --plugin trayicon
X-GNOME-Autostart-enable=true

Afterwards, go to the Zim appVM Settings, in the Basic Tab check
:ballot_box_with_check: Start qube automatically on boot.

Further customization can be easily made in the zim folder:

ls  ~/.config/zim

Done. :partying_face:

Now, you have an easy solution in Qubes OS, to quickly note some thoughts, work on your daily to do’s list, or manage your offline bookmarks.

Enjoy

5 Likes

Very nice writeup! There was a fella asking about such a thing for setting up in QubesOS. I hope he sees this.

2 Likes

Zim is a cool software, although I fail to see if there is something specific to Qubes OS in this guide?

1 Like

Essentially, an alternative Qubes OS workflow for a bookmark manager.

4 Likes

Setting Zim to use a dark theme by modifying the following file

  ~/.config/gtk-3.0/settings.ini
[Settings]
gtk-application-prefer-dark-theme=1

rendered some formatting unusable (for instance, highlighting and links). Modifying the following settings provides a simple fix:

nano  ~/.config/zim/style.conf
[Tag mark]
background=lightyellow
foreground=black

[Tag code]
foreground=lightgray

[Tag pre]
foreground=lightgray

[Tag link]
foreground=lightblue
5 Likes