Chris Bissette

Further Experiments with Zettlr

After setting up Zettlr on my PC this morning and realising that it may well be my ideal writing environment, I decided that what I really want is to have identical environments on every machine I write on. That means my PC (done), my windows laptop (done), my Linux laptop (not done yet, as I haven’t received the machine yet), and my Chromebook.

I suspected the Chromebook might be impossible, but after an hour or so of trying different approaches I managed to get it working. For reference I’m using an Acer Chromebook 311 C722 running Version 136.0.7103.102 of ChromeOS. Your mileage may vary.

Before we start, please bear in mind that I’ve been bulldozing my way through this with zero prior experience or knowledge. If my terminology is weird or if I’m missing something obvious or you can tell I’m getting things wrong, know that I went into this with zero idea what I was doing.

Flatpak is Unreliable on ChromeOS

Although Zettlr is available as a Flatpak, ChromeOS’s sandboxed Linux container introduced a bunch of problems. The main issue I encountered seemed to be to do with Zettlr’s Flatpak metadata becoming corrupt, defaulting to start-zettlr (a non-existent command) for reasons I couldn’t diagnose or solve. The result was that I could get Zettlr to launch once, but then it would fail after being closed. This issue persisted even after uninstalling everything and rolling back every change I’d made to the system.

Missing Dependencies are a Pain

After failing with the Flatpak version I decided to try the .deb version of Zettlr. Unfortunately this just wouldn’t work with Crostini, with a couple of libraries (libgtk-3.0 and libnss3) unable to be installed. Even after enabling contrib and non-free, key packages remained unavailable or broken, likely because Crostini uses a minimal Debian base with limited access to graphical and 32-bit libraries (and I definitely knew what any of this meant three hours ago, honest).

The AppImage Works, With A Little Help

The ARM64 AppImage version of Zettlr can run smoothly, but only after addressing a couple of blockages. (I’m using an ARM-based Chromebook, so I needed the ARM64 version of the AppImage. If your Chromebook has an Intel or AMD processor you’ll probably need the x86_64 version instead).

The AppImage was looking for a file called libz.so but my system only had a version called libz.so.1. To fix this, I created a shortcut file with the right name that pointed to the version my system actually had. That way, when Zettlr looked for libz.so, it was pointed at the correct version.

libfuse.so.2 was missing, and fixed by installing libfuse2.

The biggest issue was that ChromeOS mounts the Linux home folder with a restriction called noexec, which prevents apps being run from that location. This meant that even though I marked the Zettlr AppImage as executable I couldn’t actually launch it.

To get around this, I moved the AppImage to a system-level folder (/opt/appimages). After updating my launcher to point to the new location, Zettlr launched reliably from the app menu.

Manual Launcher Creation is Required

Once it’s working, Zettlr doesn’t appear in the launcher by default. A custom .desktop launcher needs to be placed in ~/.local/share/applications/. I had to create the directory manually to get this to work reliably. I needed to manually set Exec to point to the relocated AppImage and Icon to a local .png file (that last bit is obviously not crucial, but accurate icons are nice to have). The .desktop launcher also needs to be marked as executable, otherwise it will silently fail when you try to launch it, which took me far too long to figure out and is probably obvious to anybody who actually knows what they’re doing.

Linux Needs To Be Shown Google Drive

An important part of having identical writing environments on my various machines is working on the same documents and keeping them synced. Initially Zettlr couldn’t see any of my GDrive folders or files, but it’s very straightforward to tell GDrive to share any folders you need with Linux (go to your File Explorer, right click on a folder, click ā€œShare with Linuxā€). This step probably isn’t important enough to warrant me writing about it, but it was briefly a stumbling point so I’m including it just in case.

The Result

It works. That’s all that matters, right? It’s a little slow to load and I haven’t used it for long enough to know whether there are any weird sync issues that arise due to running Zettlr in a Linux environment inside of ChromeOS, but if I do encounter anything like that I’ll update this post to reflect it.

My next goal is going to be figuring out how to use the same fonts. (I mentioned this in an old post, but the main reason I use lualatex is that it supports calling fonts by name. I believe xelatex does this as well, but I know there was a reason I stuck with lualatex two years ago that I’ve now forgotten.) I expect that I’ll need to install the fonts I use into the Linux container, but that’s going to be a task for another day. I may have issues with ITC Avant Garde Pro, since I think I license that through Adobe, but maybe I just need to bite the bullet and stump up the Ā£20 to buy the single weight I use in these PDFs.

#blog #markdown #pandoc #workflow #zettl