XSession

You might want to add DWM as a session to start it conveniently from a display manager.

.desktop file

As root create a file like this:

$ cat /usr/share/xsessions/dwm.desktop
[Desktop Entry]
Encoding=UTF-8
Name=dwm
Comment=Dynamic window manager
Exec=dwm
Icon=dwm
Type=XSession

with these permissions

$ ls -l /usr/share/xsessions/dwm.desktop
-rw-r--r-- 1 root root 108 Jun 27 17:24 /usr/share/xsessions/dwm.desktop

Execute a script

Optionally rather than executing dwm directly you could execute a shell script instead that writes stdout / stderr to a file for logging purposes. This also helps to autostart apps

E.g.

Exec=startdwm

and

$ cat /usr/local/bin/startdwm
#!/bin/sh
echo "$(date): Starting dwn" >> /path/to/logs/$(date +%Y-%m-%d_%H.dwm.log)
dwm >> /path/to/logs/$(date +%Y-%m-%d_%H.dwm.log) 2>&1

$ ls -l /usr/local/bin/startdwm
-rwxr-xr-x 1 root root 204 Sep 19 14:12 /usr/local/bin/startdwm

Credits

Thank you u/bakkeby for providing this information on Reddit https://www.reddit.com/r/suckless/comments/jj61py/comment/gaanvez/