How to install shady in Raspberry Pi4 without a display (headless)

shady is a CLI tool to render GLSL shaders.

I use it to display animations on my LED-Cube.

Important notes :

I only managed to install shady under the 32-bit version of the Raspberry Pi OS.

Under the 64 bits version, I receive the following error :

gcc: error: unrecognized command-line option '-marm'

If you install shady in a headless OS (without display), you must still install the X11 libraries. They are necessary for compilation.

Recipe to install shady :

1. Install the OS :

I use the Raspberry Pi OS Lite (32 bits) image with my Raspberry Pi 4 :

raspberry-imager-32bits-os-lite.png

2. Make sure the OS is up-to-date :

$ sudo apt update && sudo apt upgrade -y

3. Install dependencies needed for shady :

$ sudo apt install git build-essential libxcursor-dev libxinerama-dev libxi-dev libx11-dev libglu1-mesa-dev libxrandr-dev libxxf86vm-dev -y

4. Install the "go" language :

Note: if you are not using bash as shell, you need to adapt the instructions below.

$ DEST="$HOME/.local/share"
$ mkdir -p $DEST
$ VERSION=1.21.1
$ wget https://dl.google.com/go/go$VERSION.linux-armv6l.tar.gz
$ tar -C $DEST -xzf go$VERSION.linux-armv6l.tar.gz
$ SHELL_RC="$HOME/.bashrc"
$ echo 'export GOPATH=$DEST/go' >> "$SHELL_RC"
$ echo 'export PATH=$DEST/go/bin:$PATH' >> "$SHELL_RC"
$ rm go$VERSION.linux-armv6l.tar.gz

reload .bashrc and check go :

$ source ~/.bashrc
$ go version
go version go1.21.1 linux/arm

5. Install shady :

If you run a headless OS, verify that $DISPLAY is empty :

$ echo $DISPLAY

If needed, you can force $DISPLAY with :

$ export DISPLAY=

Install shady :

$ go install github.com/polyfloyd/shady/cmd/shady@latest

shady will be installed in $DEST/go/bin :

$ which shady
/home/francois/.local/share/go/bin/shady

Check that shady runs ok :

$ shady -?