Because Pi uses the Fyne UI toolkit, it has native support for Wayland GNU/Linux systems.
All Pi builds provided on this repo are built with X11, because the majority of Wayland setups can run X11 apps (through XWayland) but virtually no X11 setups can run Wayland apps.
This is why if you're running a setup without XWayland, the default Pi binaries will crash when you launch them. In order to avoid this, build the Pi executable with the Wayland tag. Like so:
git clone https://forge.sunglocto.net/sunglocto/pi-im
cd pi-im
go mod tidy
go build -tags wayland .
./pi-im
There are also other reasons for using the Wayland native executable, for example the ability of dragging and dropping files, and less lag.
Pi support for Wayland FreeBSD setups has been untested. Those on a FreeBSD setup, please report any issues you experience whilst using Pi.