I tried installing LXDE on my Yoga Book within GNURoot Debian… but I was becoming frustrated with the slow performance and felt LXDE was a bit overkill.
My goal here was to get a linux system setup on my Yoga Book which was more geared towards writing latex via vim: All I wanted was a good terminal, latex compiler, and pdf viewer.
I mostly care about the terminal here, and the
GNURoot debain just doesnt have the functionality I’d like, so a light UI with
terminator sounds like the right way to go.
I finally decided that there was no need for a full blown UI like LXDE, so I opted for just using openbox, the most minimal approach I could find that didn’t require laborius tweaking to get it right.
Here are the steps I took to get openbox running on a clean install of GNURoot Debian. Once you launch it for the first time it’ll run a little installation script, then you’ll be ready to start using the terminal (as seen in the screenshot below).
Now we can start throwing commands in the terminal!
- Update debain with:
apt update; apt -y upgrade
- Install a VNC server and openbox (along with a few other usefull apps):
apt -y install tightvncserver sudo openbox nano terminator tint2 gmrun
tint21is a dock for openbox (absolutely necessary in the case when you minimize a window) and
gmruncan be assigned to a key binding to quickly run commands and launch programs.
- As we’re probably going to be loading our VNC server regularily, lets make a script to make life easier. Run the following two commands:
echo "sudo tightvncserver -geometry 1920x1120 -depth 16 -dpi 144 :1" >> startVNC echo "sudo tightvncserver -kill :1" >> stopVNC
This should drop two text files which you can execute with
-dpi 144argument is key here. Without it, it will default to 75 dpi which results in unreadably-small text. Also, the first time you do this it typically asks for a password for the server session. Let’s keep things simple and use
gnuroot, which happens to the be the same password that GNURoot Debian uses when it creates a VNC session for its XTerm mode.
- We just need to do a little tweaking now… lets set up
tightvncso that it loads
openboxas the window manager rather than the default
tmw. To initialize a VNC statup script, so go ahead and type:
sh startVNC sh stopVNC
Running these two scripts we made in the previous step will launch VNC, create a startup script we can edit with
nano, then kill the server we just opened.
- Now lets use the command
nano /root/.vncto change our startup script so it looks like this:
#!/bin/sh xrdb $HOME/.Xresources xsetroot -solid grey openbox-session & tint2 & terminator &
Save your edits, then exit nano.
- Finally… download VNC viewer and create a client that connects to
localhost:1, using our password
gnuroot. As a side note, the Xterm mode on GNURoot debian uses
And now… here’s a preview of the result. I installed
evince and did a quick test with
vimtex to validate that I can compile latex documents and evince will automatically update with the latest document.
Some further tweaks…
To streamline my workflow I added the following keybindings to
<keyboard> <!-- Keybindings for Yoga Book --> <keybind key="C-A-r"> <action name="Execute"> <command>gmrun</command> </action> </keybind> <keybind key="C-A-Left"> <action name="MoveResizeto"> <width>50%</width> <height>100%</height> <x>0</x> <y>0</y> </action> </keybind> <keybind key="C-A-Right"> <action name="MoveResizeTo"> <height>100%</height> <width>50%</width> <x>-0</x> <y>0</y> </action> </keybind>
This lets me run commands with
Ctrl Alt R and
Ctrl Alt Left/Right will draw the window on that half of the screen, so I can arrange my windows without having to fiddle with the mouse.
I also restricted
openbox to just one desktop (right click on the desktop and select
ObConf for the GUI options).
A Better LaTeX Workflow
Editing latex through vim through GNURoot debian turned out to be a bit of a pain, so I tried a new workflow using GNURoot debian to compile and preview
tex files and using VerbTeX Pro to edit the docs.
The workflow goes as such:
- Get the Pro version of
VerbTeX. This allows unlimited local files on your device.
- In VNC viewer (using the GNURoot Debian session as described above), install
apt install texlive-full
git, clone the repository of your choice to the local folder of VerbTeX (
/sdcard/VerbTeX/Local). Now you can view and edit this file in VerbTeX.
- To start automatically compiling in VNC viewer upon evey change of your tex file, run the follwoing command:
latexmk -pdf -pvc -interaction=nonstopmode yourlatexfile.tex
I streamlined this by writing a bash script in my
#!/bin/bash latexmk -pdf -pvc -interaction=nonstopmode $1
This lets me run the following command to compile (when in the directory of the tex document):
sh ~/compilelatex mylatexfile.tex. The argument
-interaction=nonstopmodewill skip errors and user input prompts.
- Finally, open the file in
evince, which will automatically update when the file is recompiled.
With this flow, everytime you save the doc in
VerbTeX Pro, it will automatically recompile and update the preview in
Ctrl s followed by
Alt Tab in VerbTeX will immediatey show you the updated document.
When finished, you can just
git push to upload your changes.
I think I’ve got the best workflow possible here… With mendeley and this latex flow, an android tablet should be a pretty strong workstation for writing academic documents.
Updated on: 2018-03-24