Add systemd timers to auto-mute/unmute when idle-inhibit is active
Mutes audio at 21:00 and unmutes at 07:00, but only when the idle-inhibit toggle is active (PID file exists). This is useful for leaving the computer running overnight for SSH access while keeping it quiet for sleeping.
This commit is contained in:
parent
14a94a4ece
commit
feafe252dc
5 changed files with 43 additions and 0 deletions
7
systemd/user/auto-mute.service
Normal file
7
systemd/user/auto-mute.service
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[Unit]
|
||||
Description=Mute audio when idle-inhibit is active
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecCondition=/bin/bash -c 'test -f ${XDG_RUNTIME_DIR}/idle-inhibit.pid && kill -0 $(cat ${XDG_RUNTIME_DIR}/idle-inhibit.pid)'
|
||||
ExecStart=/usr/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue