This is a simple setup for automatically starting brother_ql_web as soon as you plug it into your computer, and have it automatically stop when the printer is disconnected or enters suspend.
This procedure is based on using rootless podman with a systemd user instance, which makes the whole process pretty tight, all things considered.
- Make sure you've got some fonts in
${XDG_DATA_HOME}/fonts
. - Ensure you're in the right group to actually access your USB printer (obviously)
- Get your idVendor (should be
04f9
) and idProduct (e.g.2028
for a QL-570) by usingudevadm info --attribute-walk --path=$(udevadm info --query=path --name=/dev/usb/lp0)
- Replace the appropriate entries (
$VENDORID
,$PRODUCTID
) in70-brother-printer.rules
. - Put the configuration into
/etc/udev/rules.d
, reload withudevadm control --reload
. - Power cycle the printer.
- Ensure everything worked by doing
systemctl list-units | grep sys--subsystem-lp-devices
and checking for your printer serial in there. - Replace
$TYPE
(syntax) and$SERIAL
inbrother_ql_web.container
and put it into${XDG_CONFIG_HOME}/containers/systemd
(i.e. usually~/.config/containers/systemd
) - Reload the container unit with
systemctl --user daemon-reload
. - Power cycle the printer.
- You should see the printer web service container starting in the journal, check the output; when finished, it'll be available at http://127.0.0.1:8013/