Setting up hikari on a fresh FreeBSD 13.0 installation

Hikari is a hybrid tiling/stacking Wayland compositor. It is developed primarily on FreeBSD, and since I wanted to give FreeBSD 13.0 a try, I’ve decided to set it up.

Ultimately, the setup was not trivial so I chose to write down some notes here to not forget how my dotfiles came to be. Feel free to use this if you run into trouble getting it to run on your own fresh FreeBSD installation.

Hikari setup on a Latitude E6530

Hikari’s installation on FreeBSD is really smooth (pkg install hikari, you can use ports as well). I’ve ran into problems though, mostly because of some GPU oddities on my Latitude E6530 laptop (it has two GPUs - a discrete NVIDIA card, and an integrated Intel chip).

To get hikari running on FreeBSD on such a device:

  1. Keep NVIDIA Optimus enabled in BIOS
  2. Make sure you don’t have an NVIDIA driver installed. The GPU is really old and NVIDIA did not support Wayland on its proprietary drivers until very recently. FreeBSD does not seem to have the open source driver available, or at least I was not successful at getting it to run. Interestingly, Wayland failed to start with NVIDIA drivers installed but with the module not loaded. I am not entirely sure why.
  3. Make sure you have the i915kms module loaded, and seatd enabled in rc.conf
kld_list="i915kms"
seatd_enable="YES"
  1. Make sure you have the XDF_RUNTIME_DIR set in your .bashrc or .zshrc. For this, I used the below to ensure proper rights on that directory:
export XDG_RUNTIME_DIR=/tmp/`id -u`-runtime-dir
test -d "$XDG_RUNTIME_DIR" || \
	{ mkdir "$XDG_RUNTIME_DIR" ; chmod 700 "$XDG_RUNTIME_DIR" ; }
  1. Make sure you copy the hikari.conf example from /usr/local/etc/hikari/hikari.conf to your ~/.config/hikari/ directory to get some reasonable default settings, and perhaps configure some options as well. A few key settings I found useful from the very beginning are:
actions {
  shell = "alacritty"
  firefox = "firefox"
  wofi = "wofi --show run"
  volup = "aumix -v+8"
  voldown = "aumix -v-8"
  volmute = "mute"
}

These provide actions that you can later bind to keyboard shortcuts:

bindings {
  keyboard {
    "L+Return" = action-shell
    "L+b" = action-firefox
    "LS+Return" = action-wofi
    "+XF86AudioRaiseVolume" = action-volup
    "+XF86AudioLowerVolume" = action-voldown
    "+XF86AudioMute" = action-volmute
  }
}

Of course, you have to make sure that all the relevant applications: alacritty, firefox, aumix, wofi; are installed. 6. If you want to use waybar or any other application that should start automatically with hikari, you need to add it to the autostart file in the ~/.config/hikari/ directory (just like you would to an .xinitrc file). Be sure to make the file executable though - it took me ages to realize that.

chmod +x ~/.config/hikari/autostart

Once all of this is done, you can run hikari by executing the hikari command in the terminal. I have also created an alias in my .zshrc to make this a bit faster:

alias h='hikari'