2022-01-12

Debian on Hifive Unmatched 2: GUI

#software

Last week I reported success on installing Debian on the Hifive Unmatched machine.

/en/2022/20220106-debian-on-hifive-unmatched.gmi

I spent another evening with the still new toy.

sway

Installing the sway window manager is only one command to the packagemanger away. The more tricky part is to come up with a fitting configuration. That wasn't so difficult, because I use sway on a small notebook, too. Sway started immediately, the i3status bar appeared, but no terminal. That's actually kind of stupid, because there is nothing to type into. The launcher didn't work either. That part was to be exepected, since dmenu needs xwayland to run. So I resorted to other means:

sway --debug |& tee zz.log

sway will helpfully log quite a bit of information thanks to the --debug switch, and the logfile can be examined later.

Turned out that the foot terminal executable was unhappy about the environment variable LANG not being initialized, let alone lacking utf-8 support. Now at least I had a hint about what was broken. The fix turned out to be fairly simple:

sudo apt install locales
export LANG=C.UTF-8
sway

And yes, from now on terminal windows were showing up and working! Yay! While you are at it (migration to sway). check out this interesting site listing pointers to useful parts [a].

alacritty + fzf + compgen = launcher

Somewhere[b] I found a nice hack to use alacritty (another terminal program), fzf (command line fuzzy finder), and the compgen shell builtin (generate possible completion matches) to work together as a launcher. Thing is, that alacritty does not have a installable package so far. But since this program is free software, who can stop me from building from scratch? Nobody. Allright then!

Long story short: alacritty is a rust program, and as such cargo downloads a surprising number of crates and builds the whole heap of stuff. While this is only one call to cargo away, it took quite some time: downloading was a few minutes, but building was somewhere between 40 and 50 minutes on this particular machine. That might have a lot of separate causes adding up, I am using a bleeding edge system, so I cannot seriously complain. However, alacritty worked immediately!

Oh, the hack? Add this to ~/.config/sway/config

bindsym $mod+d exec alacritty --class 'launcher' --command bash -c 'compgen -c | LANG=C.UTF-8 sort -u | fzf | xargs -r swaymsg -t command exec'
for_window [app_id="^launcher$"] floating enable, border none, resize set width 50 ppt height 40 ppt, move position 0 px 0 px

This works without xwayland and I really like this!

emacs from scratch

If building software from scratch works, shouldn't it work a second time? I set out to compile emacs from it's current master branch in git. I did copy the build dependencies from emacs' source package control file. The list is quite impressive, but even more so is the fact, that this list installed without a hitch on the newfangled riscv64 system! I was impressed!

mkdir Source; cd Source
git clone git://git.sv.gnu.org/emacs.git
sudo apt install bsd-mailx libncurses5-dev texinfo liblockfile-dev librsvg2-dev \
    dbus-x11 git gnupg-agent libgif-dev libtiff-dev libsystemd-dev procps \
    xaw3dg-dev libpng-dev libjpeg-dev libm17n-dev libotf-dev libgpm-dev libdbus-1-dev \
    autoconf automake quilt libxaw7-dev sharutils imagemagick libcairo-dev libgmp-dev \
    libgtk-3-dev libgnutls28-dev libxml2-dev libselinux1-dev libharfbuzz-dev \
    libjansson-dev libasound2-dev libmagick++-6.q16-dev libacl1-dev zlib1g-dev
cd emacs
./autogen.sh
./configure --with-pgtk --with-mailutils
make -j8
sudo make install

This took a little over an hour to complete. And the "pure gtk" build of emacs works with wayland, so again, no xwayland needed.

Fin

So the Hifive Unmatched clearly is not a rocket, despite it featuring 16 GiB of memory. But it is definitely good enough to read email, write text documents, surf gemini space and some big web, write a bit of source code ...

I repeat: Thanks to all the kind, busy, restless, sometimes sleepless souls, who advance these wonders! Without your contributions I wouldn't be anywhere near a useable machine! You are the very giants on whose shoulders I may sail almost effortlessly ...

Cheers,

~ew

[a] sway/wiki/Useful-add-ons-for-sway

[b] laucher hack and more by Scott Gilbertson

Home