•
Using E-Ink tablet as monitor for Linux
By Alireza Alavi • 8 minutes read •
Table of Contents
Yesterday, I was writing and doing research about software licenses. I read through heaps and walls of legal text and different licenses, taking notes and making sense of them. After about fourteen hours of this, I felt like my eyes were ready to quit. I thought it would be really nice if I could use my old Android E-ink tablet as a display for reading and writing text, with much less strain on the eyes.
I got it to work and I'm going to document it here so both the future me remembers, and maybe you find it useful and your eyes thank you.
Here is what I am working with:
- OS: Linux (Arch, btw. but doesn't matter)
- i3wm (X11)
- E-ink tablet: Onyx BOOX Air 2 (It being Android matters, if not, you must find a VNC client for your tablet)
- I just want to mirror one of my screens to the tablet, I don't care about extending the screen.
Showcasing end results
The latency with VNC is very little. The main bottleneck is the low refresh rate and the lag of my old E-ink tablet. This can be a much better experience with a newer tablet with higher refresh rate.
I still like this though; It is good for just writing with minimal distractions, and less eye strain, but it is amazing for reading.
How I use this
I think this will be best used in a dual monitor setup (minus the e-ink).
One is just a mirror to the e-ink, which sometimes helps, taking glances at it for some things that need color.
The second monitor will be used for other things besides reading and writing.
I do not use the E-ink tablet as my main monitor. I use it 70% for reading and 30% for writing simple text. This depends on your tablet, it's refresh rate and quality but with my tablet, writing code or doing things like browsing the web isn't a good experience because of the latency.
There is another pro: It's more than a monitor. The VNC connection grants you the ability to use your tablet as the input device too.
This way, I open the thing that I need to be reading or reviewing, pick up my tablet and just roam around the office, scrolling the pages, making small edits.
I also use the tablet for drawing things in GIMP or whatever while explaining things to my co workers and during presentations. So it also acts as a pretty good drawing tablet.
Attempt1: Deskreen
Deskreen is great, and has its use cases, specially that it's so simple to use even a hamster can use it. But the issue was that you should view your screen inside a browser. That has two problems for our use case:
- The streaming quality is not amazing. For reading text, you need crisp letters and high quality
- The input lag is way too much. My rusty BOOX Air2 already has considerable input and rendering lag. I can't afford anymore.
So Deskreen failed for me.
Attempt2: VNC
Setting up a VNC servers seemed a bit daunting at first (that's why I'm writing this) but I got it working in ~20 minutes.
We will use TigerVNC as our server, and AVNC for our Android client (E-ink tablet)
Setting up the VNC server
As always, the Arch wiki is a great resource, regardless of your distro. See TigerVNC arch wiki.
Here, I will provide a quick-start.
Install and initial setup
install the tiger vnc package. For arch:
sudo pacman -Sy tigervncThen, according to the Arch wiki,
- Create a password using
vncpasswdwhich will store the hashed password in$XDG_CONFIG_HOME/tigervnc/passwd. Ensure the file's permission is set to 0600. If creating vncserver access for another user, you must be logged in as that user before running vncpasswd.vncpasswd sudo chmod 0600 $XDG_CONFIG_HOME/tigervnc/passwd - Edit
/etc/tigervnc/vncserver.usersto define user mappings. Each user defined in this file will have a corresponding port on which its session will run. The number in the file corresponds to a TCP port. By default, :1 is TCP port 5901 (5900+1). If another parallel server is needed, a second instance can then run on the next highest, free port, i.e. 5902 (5900+2)./etc/tigervnc/vncserver --- :1=alireza - Create $XDG_CONFIG_HOME/tigervnc/config and at a minimum, define the type of session desired with a line like session=foo where foo corresponds to whichever desktop environment is to run. One can see which desktop environments are available on the system by seeing their corresponding .desktop files within /usr/share/xsessions/. For example:
$XDG_CONFIG_HOME/tigervnc/config
---
session=i3
geometry=1400x1050+0+0
passwd-file=$XDG_CONFIG_HOME/tigervnc/config
FrameRate=30
localhost
alwayssharedNOTE: Notice the geometry. 1400x1050 is roughly the resolution of my E-ink display, that my computer display also supports, while +0+0 tells the coordinates of the screen (xrandr things). So this means that "Share a 1400x1050 view of my screen, starting from position 0, 0 (top left corner)". This makes the screen fit perfectly within the tablet's display with no borders and use as much screen as possible. You could just go with your original resolution and get more borders.
NOTE: the tigervnc/config file is used for vncserver. we will be using x0vncserver which needs these options passed to it directly (more on that later).
NOTE: you must change the resolution of your computer screen to 1400x1050, or whatever you set in geometry.
Run x0vncserver directly
Now to quickly test.
x0vncserver \
-PasswordFile $HOME/.config/tigervnc/passwd \
-Geometry 1400x1050+0+0 \
-FrameRate 30 \
-AlwaysShared \
-SendCutText=false \
-SendPrimary=false \
-AcceptCutText=falseNOTE: We are passing all the configurations we want directly to x0vncserver because it doesn't read from .config/tigervnc/config.
NOTE: The only mandatory option is -PasswordFile. The rest are optional, see what suits you: man x0vncserver.
- Running the above command will also output on which port it is listening on (default is 5900).\
- Open the port in your firewall if needed.\
- Now connect from the client (Android E-ink table) with AVNC(or any VNC client) to the IP and port (e.g. 192.168.0.50:5900).
Of course, both devices need to be reachable within their network connections.
Running x0vncserver automatically
There are a couple of ways to do this, listed in the Arch wiki.
Running things in a script
I will just use a simple script to go into my "e-ink mode", so I can quickly run it from my rofi script runner. You can probably find the script here
It looks something like this:
#!/usr/bin/env sh
PRIMARY_DISPLAY=`xrandr --listactivemonitors | sed '2q;d' | cut -d " " -f 6`
SECONDARY_DISPLAY=`xrandr --listactivemonitors | sed '3q;d' | cut -d " " -f 6`
# Set display size to the same size as the e-ink display
xrandr --output $PRIMARY_DISPLAY --mode 1400x1050;
# Adjust secondary display to position to the right of the first screen
xrandr --output $SECONDARY_DISPLAY --right-of $PRIMARY_DISPLAY;
# Start the x0vncserver session
x0vncserver \
-PasswordFile $HOME/.config/tigervnc/passwd \
-Geometry 1400x1050+0+0 \
-FrameRate 30 \
-AlwaysShared \
-SendCutText=false \
-SendPrimary=false \
-AcceptCutText=falseFootnotes
If you feel like you have to encrypt your VNC connection, see arch wiki. I don't think it is needed for me since I am using this at home or work, there aren't many threats.
Use a light theme for Neovim and other things when using with E-ink. The
shinetheme that is installed by default is pretty sweet::colorshceme shineor just try:set background=lighton different themes! But it's best the theme is high contrast and has true white background (not gray or something).The BOOX Air2 has different "refresh modes" in it's "E-ink center": normal, regal, speed, A2, X
These are horribly named, So here is the description from the manual:Normal Mode (Default): Good display effect, suitable for ordinary text reading.
Speed Mode: Slight ghosting and aliasing effect, suitable for thumbing through eBooks with text and images.
A2 Mode: Slightly heavier ghosting and aliasing effect, suitable for browsing images and text by quick sliding.
X Mode: Heaviest ghosting and aliasing effect accompanying detail loss, suitable for browsing websites and video playback.From my usage, for reading text "normal" is great. But don't scroll around too much. Try to use PageUp and PageDown
For writing though, "normal" is not really usable. Use the "Speed" or "A2"mode for writing. The ghosting makes them less than ideal for reading, but they are still OK.
The "X" mode gives you lower quality but higher refresh rate and less latency. I think X mode is great for using your tablet as a drawing tablet.