WindowMaker systemd graphical-session user unit on Debian Testing/Bookworm

As far as I know, WindowMaker and other basic window managers on Debian do not provide the systemd "graphical-session.target", at least as of this writing (Jun 2022). Thus we need to bodge one in so that things depending on the target will start as expected and not before.

Create file /etc/systemd/user/wmaker-session.target (or $HOME/.config/systemd/user/wmaker-session.target) with contents:

[Unit]
Description=WindowMaker session
BindsTo=graphical-session.target

Then, to start the unit, we can utilize WindowMaker's autostart file. Unfortunately it seems (?) that there is no global equivalent for it, so it has to be user-specific. If not already existing, create file $HOME/GNUstep/Library/WindowMaker/autostart with contents:

#!/bin/sh
systemctl --user start wmaker-session.target

The file may already exist and contain other things, just add the systemctl line as first line then. If the file did not exist, remember to set executable permission:

chmod u+x $HOME/GNUstep/Library/WindowMaker/autostart

Now you need to systemctl --user daemon-reload and restart your session. You can check the status of the unit working via systemctl --user status graphical-session.target, and systemctl --user list-dependencies graphical-session.target. If they aren't working, rebooting may help.

Notes

I wish this was implemented by default on "simple" window managers, but alas it is not. There is a Debian bug #1003816 for i3 regarding the same topic, but nothing has come of it.