46 lines
1.9 KiB
Desktop File
46 lines
1.9 KiB
Desktop File
[Unit]
|
|
Description=Headroom audio daemon (automatic loudness and per-app volume control for PipeWire)
|
|
Documentation=https://github.com/atagen/headroom
|
|
# PipeWire is a hard dependency: headroom registers a virtual sink and
|
|
# wires explicit links via PW's link-factory, so we can't start before
|
|
# pw-mainloop is up. ConditionUser ensures this only ever runs as a
|
|
# user-scope unit, never accidentally as the system instance.
|
|
After=pipewire.service pipewire-pulse.service wireplumber.service
|
|
Requires=pipewire.service
|
|
Wants=wireplumber.service
|
|
# Tie our lifecycle to the graphical session: graphical-session.target is
|
|
# started once per login by the compositor/DE and is the conventional anchor
|
|
# for user-scope session daemons. PartOf= means we stop/restart with it.
|
|
# (pipewire.service is socket-activated and has no stable "started for the
|
|
# session" lifecycle to WantedBy=, which is why anchoring there was flaky.)
|
|
PartOf=graphical-session.target
|
|
After=graphical-session.target
|
|
ConditionUser=!@system
|
|
|
|
[Service]
|
|
Type=simple
|
|
ExecStart=@bindir@/headroom daemon
|
|
# Restart on failure but not too aggressively — a tight crash loop
|
|
# would just produce a lot of stderr noise and clobber the user's
|
|
# routing repeatedly.
|
|
Restart=on-failure
|
|
RestartSec=2s
|
|
# Headroom doesn't fork; SIGTERM is the clean shutdown path. The
|
|
# default KillMode=control-group is correct for a single-process
|
|
# daemon; explicit here for clarity.
|
|
KillMode=control-group
|
|
TimeoutStopSec=5s
|
|
# Surface stdout/stderr to journald so `journalctl --user -u headroom`
|
|
# shows daemon logs with the expected RUST_LOG filtering.
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
SyslogIdentifier=headroom
|
|
# Realtime hint — pipewire grants RT scheduling via pw_thread_loop,
|
|
# but the daemon main thread benefits from a slight scheduling boost
|
|
# too. LimitRTPRIO matches the pipewire user unit's grant.
|
|
LimitRTPRIO=20
|
|
LimitRTTIME=200000
|
|
LimitNICE=-11
|
|
|
|
[Install]
|
|
WantedBy=graphical-session.target
|