Prevents swayidle/hypridle from sleeping while any application is outputting or receiving audio. Requires systemd/elogind inhibit support.
This only works for Pulseaudio / Pipewire Pulse
Arch: The package is available on the AUR
Other:
# Can compile to use systemd or elogind
# systemd (default)
meson setup build -Dlogind-provider=systemd
# or elogind for systemd-less systems
meson setup build -Dlogind-provider=elogind
meson compile -C build
meson install -C buildIn addition to the c++ compiler of your choosing:
apt install meson pkgconf libsystemd-dev libpulse-dev# Enables inhibit_idle when playing audio
exec sway-audio-idle-inhibitThese could be used to monitor if any application is using your mic or playing any audio.
Monitor sources and sinks: will print RUNNING or NOT RUNNING
sway-audio-idle-inhibit --dry-print-bothMonitor sources: will print RUNNING or NOT RUNNING
sway-audio-idle-inhibit --dry-print-sourceMonitor sinks: will print RUNNING or NOT RUNNING
sway-audio-idle-inhibit --dry-print-sinkA custom waybar module can be used to display an icon when any application is using your mic or playing any audio.
Add the following section to your ~/.config/waybar/config file and add
custom/audio_idle_inhibitor to either the modules-left, modules-center
or modules-right list.
Note: The FontAwesome font is used for the icons below
"custom/audio_idle_inhibitor": {
"format": "{icon}",
"exec": "sway-audio-idle-inhibit --dry-print-both-waybar",
"exec-if": "which sway-audio-idle-inhibit",
"return-type": "json",
"format-icons": {
"output": "",
"input": "",
"output-input": " ",
"none": ""
}
},