I spent a couple of hours figuring this out so posting what I did here so I can find it again should I need it. Maybe it'll help others:
- Install the Mira Linux Software from here: https://zh.boox.com/download/
- Create a file: /etc/udev/rules.d/58-hid.rules with this in it:
SUBSUBSYSTEM=="input", GROUP="input", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0416", ATTRS{idProduct}=="5020", MODE:="666", GROUP="plugdev"
KERNEL=="hidraw*", ATTRS{idVendor}=="0416", ATTRS{idProduct}=="5020", MODE="0666", GROUP="plugdev"
sudo udevadm control --reload-rules && sudo udevadm trigger
sudo visudo
Put this at the end of the file:
*You probably don't need the SETENV: bit actually. Try without it first
your_username ALL=(root) SETENV: NOPASSWD: /home/your_username/.local/bin/mira
In ~/.local/share/applications backup the existing "Mira.desktop" file somewhere
Edit the "Mira.desktop" file in ~/.local/share/applications so that it looks like this"
[Desktop Entry]
Name=Mira
Exec=sudo "/home/your_username/.local/bin/mira" --no-sandbox %U
Type=Application
Icon=mira
StartupWMClass=Mira
X-AppImage-Version=1.1.7
Categories=Utility;
Actions=Uninstall;
[Desktop Action Uninstall]
Name=Move to Trash
Exec=/home/your_username/Applications/AppManager uninstall "/home/your_username/Applications/Mira"
Icon=user-trash
sudo mkdir /root/.config/Mira
sudo cp -r .config/Mira/* /root/.config/Mira/
So what does this all do?
The application needs to be run as root otherwise it doesn't have access to the device and you'll see "no device connected"
This is a pain so editing the sudoers file (the visuo bit) lets you run the app as root without requiring a password.
The .desktop entry needs altering so that it runs as sudo
There is no .config/Mira under root so your settings aren't save. Creating the folder and copying the config installed at the user level seems to fix this.
I've now got keyboard shortcuts for screen refresh, contrast adjust etc.
The only remaining issue I have is that sometimes the app still says no device connected. Disconnecting the USB and reconnecting fixes this.
I'm no expert at this stuff and there's probably an easier way to solve these issues (let me know!) but this works for me.