Building the dwm window manager, st terminal, sltatus on Freebsd youtube tutorial

Hi All

I recently switched from i3wm and urxvt to the suckless dwm window manager and st terminal

So i decided to make a youtube video on how to build dwm, st and slstatus on Freebsd and linux,
one thing i did that every other youtube tutorial on dwm seems to miss is how to apply the changes to a separate git branch
and then merge the changes back into the master branch


I cover the changes you need to make to the config files to get dwm, st and slstatus to build on freebsd an linux,
how to set the font, change the shell, apply the move stack patch to dwm and the scrollback patch to the st terminal

Some notes

+ dwm freebsd notes
+ st terminal freebsd notes

My freebsd builds of dwm, st, and slstatus

+ dwm freebsd
+ st terminal freebsd
+ slstatus freebsd
 
You can also use the port, edit the config.h file, and in the make install command use DWM_CONF="path-to-config.h"'
Not sure what notes you mean but using the DWM_CONF and ST_CONF are in the Makefile.
As for patches, that too, is pretty easy with ports, put the patch file under <portname>/files, though I've found some patches didn't work for me under FreeBSD, though that may be because they're fairly old patches--don't think they work under Linux anymore either, :-(
 
  • Thanks
Reactions: a6h
Sorry, I should have been clearer: I downloaded direct from suckless.org and manually patched with the available patches I wanted (not many), but also sometimes my own customizations. This was for dwm, dwm-bar (made my own battery status indicator script; and the next local ISS passby time ;) ), st, slock, sent, etc.

I was referring to have OS agnostic Makefiles as in:

Code:
# FreeBSD
X11INC = /usr/local/include/
X11LIB = /usr/local/lib

rather than the usual
Code:
/usr/X11R6/include
and
Code:
/usr/X11R6/lib

It would be nice to just have it compile out of the box, at least for those just wanting to give it a try. I noticed sometimes the source Makefiles reference OpenBSD, although not always. But no reference to FreeBSD.

I should have though of starting with Ports, but I didn't know if they were matched to current.
 
I can't compile st terminal, following your steps from NapoleonWils0n GitHub

Error:

Code:
In file included from x.c:15:

/usr/local/include/X11/Xft/Xft.h:39:10: fatal error: 'ft2build.h' file not found

#include <ft2build.h>


1 error generated.

*** Error code 1


Stop.
 
I can't compile st terminal, following your steps from NapoleonWils0n GitHub

Error:

Code:
In file included from x.c:15:

/usr/local/include/X11/Xft/Xft.h:39:10: fatal error: 'ft2build.h' file not found

#include <ft2build.h>


1 error generated.

*** Error code 1


Stop.
actually I am solved this issue with installing pkg-config

$ doas pkg install pkg-config

but the new bug will raise to you by the making install for st.

the issue is

Code:
tic -sx st.info 
make[1]: exec(tic) failed (No such file or directory)
*** Error code 1

Stop.
make[1]: stopped in /home/raiden/Desktop/Build/Suckless/st

I am walking in the same steps in tutorial but the (tic) not can be found.

today is my first day in FreeBSD after years in Linux and still need someone guide me.

Note: FreeBSD version 13
 
Last edited by a moderator:
Hi guys
The slstatus shows incorrect information about computer memory.
Total ram on a computer 16 gigabytes
OS FreeBSD 12.2.
Whats wrong?
Code:
% ./slstatus -s
RAM_PERC:0%  RAM_FREE:3.4 Gi  RAM_USED:16.0 Ti  RAM_TOTAL:16.0 Ti
RAM_PERC:0%  RAM_FREE:3.4 Gi  RAM_USED:16.0 Ti  RAM_TOTAL:16.0 Ti
RAM_PERC:0%  RAM_FREE:3.4 Gi  RAM_USED:16.0 Ti  RAM_TOTAL:16.0 Ti
RAM_PERC:0%  RAM_FREE:3.4 Gi  RAM_USED:16.0 Ti  RAM_TOTAL:16.0 Ti
RAM_PERC:0%  RAM_FREE:3.4 Gi  RAM_USED:16.0 Ti  RAM_TOTAL:16.0 Ti
RAM_PERC:0%  RAM_FREE:3.4 Gi  RAM_USED:16.0 Ti  RAM_TOTAL:16.0 Ti

my config.h
C:
static const struct arg args[] = {
  /* function format          argument */
  { ram_perc, "RAM_PERC:%s%%",    "" },
  { ram_free, "RAM_FREE:%s",      "" },
  { ram_used, "RAM_USED:%s",    "" },
  { ram_total, "RAM_TOTAL:%s",     "" },
};

thanks for advice
 
Looks like ram.c is indeed broken for FreeBSD. I don't use this component, but I've just tested it and I get the same results than you.
I see two solutions : fixing the code, or calling a custom external script.
 
Something wrong with using the C API to just call the command line utility to query the RAM? There's quite a few ways to do that, such as uname -a to fish out how much RAM you actually have. OR top to fish out the percentages. ?
 
I can't compile st terminal, following your steps from NapoleonWils0n GitHub

Error:

Code:
In file included from x.c:15:

/usr/local/include/X11/Xft/Xft.h:39:10: fatal error: 'ft2build.h' file not found

#include <ft2build.h>


1 error generated.

*** Error code 1


Stop.
Hi,

Has anyone come up with a solution for this or should I search out another window manager. I love dwm and dmenu, but st is not looking good. This error comes up on any compile whether it's from an individual or from the suckless repo.

Thanks
 
Marka said:
fatal error: 'ft2build.h' file not found

A header file (extension .h) is missing. On my FBSD v13 I have this:
find / -iname ft2build.h -type f
/usr/local/include/freetype2/ft2build.h


Check if you have that file installed (it comes with /usr/ports/print/freetype2). Then check if that location is in your include path (the place with other .h files), or copy the file to your include path.
 
If you love dwm and dmenu, but are having problems with st, why not use another terminal? Change the st in the term command definition to urxt or whatever terminal you want.

I also don't understand why you don't just create your own st/config.h file and build the port with
Code:
ST_CONFIG=/home/user/st/config.h
. It seems as if you're overcomplicating it. I haven't read every post in this thread so I may have missed something, but FreeBSD makes it quite easy to build st with a custom configuration. If you're adding patches, then they can go in /usr/ports/x11/sterm/files.

The FreeBSD port is usually very up to date. If it isn't, you can email the package maintainer. For example, for awhile, dmenu was having an issue, the fix was available in an update. I emailed the maintainer and the port was updated the next day.
As I said, I haven't read the whole thread, so you may have a special reason for using github rather than the port, but the port works fine, including using custom config.h and any patches.
 
Last edited:
Sorry for being 3 years late. I am trying to build slstatus on freebsd. Updated config.mk (Here's the git diff from original version https://pastebin.com/JTaCuXyq) to set the include and library paths. However, still getting the following error: https://pastebin.com/6hbF44eA

The weird thing is sndio.h is present in /usr/local/include and was imported correctly in components/volume.c but for some reason error message states that sioctl_foobar is undefined. Also, the kvm_openfiles bit in components/swap.c which the code imports from kvm.h but kvm.h is not present in either of those locations. I am guessing that has to do Linux's Kernel Virtual Machine and part of libkvm? Problem is I didn't find that package from pkg search.

Should I try to build slstatus without the swap and volume components?
 
While it is a suckless.org program, it's a separate program from dwm. I'd suggest making a new thread about it, with an informative title like trying to build suckless slstatus on FreeBSD.
(Sorry I have no answer to your specific question, but I'm not a coder). It doesn't seem to be a FreeBSD package or port at this time.
 
Back
Top