So I installed Artix yesterday and did my usual stuff I do on an Arch install.
I installed init-headphone (https://github.com/Unrud/init-headphone & https://aur.archlinux.org/packages/init-headphone/)
from the AUR.
This package comes with a systemd service that looks as follows:
[Unit]
Description=Initialize headphone amplifier
After=suspend.target
After=hibernate.target
After=hybrid-sleep.target
[Service]
Type=oneshot
ExecStart=${sbindir}/init-headphone
[Install]
WantedBy=suspend.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target
WantedBy=multi-user.target
It runs a command "init-headphone" after suspension, hibernate etc.
I don't know how to convert this to a OpenRC service, or how to get it working via another way.
I hope someone can help me out with this.
Thanks.
There's a nice user contribution (https://github.com/goose121/initify) that converts systemd units and timers to openrc scripts and crontabs
AFAIK, both openrc and runit doesn't handle suspend/hibernate oneshot service (although in runit you can do it in a hacky way). logind (in our case, elogind) handles that. In /usr/lib/elogind/system-sleep directory, specifically.
For the details of the suspend hook, see man 1 loginctl, the Hook Directories part.