How to set up dusk for BSD - bakkeby/dusk GitHub Wiki

It is possible to run dusk on BSD, although some changes are needed to the Makefile and config.mk to make this work.

In this guide I go through my notes on what I did to get dusk running on OpenBSD.

There will likely need to be some other changes if setting this up for FreeBSD. This guide will be updated when I have more information on that.

openbsd

OpenBSD uses doas rather than sudo. On a fresh install doas is not enabled by default.

openbsd$ doas
doas: doas is not enabled, /etc/doas.conf: No such file or directory

To set this up ssh or log in as root first, then set up /etc/doas.conf [ref]

echo 'permit persist yourusername as root' > /etc/doas.conf
echo 'permit persist keepenv root as root' >> /etc/doas.conf

Then we will need to install some additional libraries:

pkg_add git libyajl imlib2

(I also installed vim)

dusk

git clone https://github.com/bakkeby/dusk.git

There are two issues in the Makefile that needs to be addressed for BSD.

One is that pre-processor directives (like ifdef and endif) start with a punctuation mark in BSD, and the other is that cp on BSD does not support the -n command line argument.

This is trivial to edit by hand, but here is also a sed command that will make those corrections:

sed -i -r -e 's/^(ifdef|endif)/.\1/' -e 's/ cp -n / cp /' Makefile

That should in principle allow dusk to be compiled and installed.

I recommend going through and sorting out st, dmenu and optionally slstatus before trying to start dusk (so that you'll be able to spawn a terminal at least to do more).

dmenu

git clone https://github.com/bakkeby/dmenu.git

For dmenu we just need to uncomment some settings in config.mk and making a change to the dmenu_run script.

sed -i -r 's/^#(FREETYPEINC|MANPREFIX)/\1/' config.mk

On BSD the setsid command is not present, so we revert the script back to how it works in the upstream suckless dmenu.

sed -i 's|xargs setsid .*$|${SHELL:-"/bin/sh"} \&|' dmenu_run

On FreeBSD the daemon command can be used as a drop-in replacement for setsid, according to my notes, but I will need to sanity check that to confirm.

sed -i -r 's/ setsid / daemon /' dmenu_run

st

git clone https://github.com/bakkeby/st-flexipatch.git

For st we have some settings that need to be uncommented and removing the -n argument for cp.

sed -i 's/ cp -n / cp /' Makefile
sed -i -r 's/^#(CPPFLAGS|MANPREFIX)/\1/' config.mk

slstatus

git clone https://github.com/bakkeby/slstatus-for-dusk.git

For slstatus we have some settings that need to be uncommented, removing the -n argument for cp, and correcting the pre-processor directives.

sed -i -r -e 's/^(ifdef|endif)/.\1/' -e 's/ cp -n / cp /' Makefile
sed -i -r 's/^(LDFLAGS.*)$/\1 -lsndio/' config.mk

For FreeBSD we also need to add -lkvm to LDFLAGS.

sed -i -r 's/^(LDFLAGS.*)$/\1 -lkvm/' config.mk

That is what I had in my notes so far. Surprisingly dbus worked without issue on OpenBSD, but there is an option to turn that off if need be (disables the use of duskc).

Feel free to reach out if you want to add something to this guide.


Back to Guides.

⚠️ **GitHub.com Fallback** ⚠️