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.
7 lines
266 B
Desktop File
7 lines
266 B
Desktop File
[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
|