feat(audio): prevent idle sleep during active audio playback - #9768
Open
edgseu wants to merge 3 commits into
Open
feat(audio): prevent idle sleep during active audio playback#9768edgseu wants to merge 3 commits into
edgseu wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When media or audio is playing in applications that do not directly manage Wayland idle inhibitor protocols (such as background music streams, certain web browsers, podcasts, terminal music players, or games), Omarchy's idle screensaver and session lock can trigger while audio is actively playing.
This PR adds an automatic audio-aware idle inhibitor daemon that keeps the system awake during active playback while strictly honoring user intent and display-off preferences.
Features
pactl subscribe) to immediately detect when audio playback starts and stops without CPU-intensive polling loops.stay-awakeindicator state ($HOME/.local/state/omarchy/indicators/stay-awake) when an unmuted, uncorked audio stream is active.stay-awakeindicator (via the top bar widget or menu) while audio is playing, the daemon records a session suppression marker and will not re-assert stay-awake for the remainder of that continuous playback.omarchy-hyprland-session-locked/SUPER + L), the inhibitor automatically yields so DPMS can turn off the display while audio continues playing seamlessly in the background.omarchy-audio-inhibit.serviceenabled ongraphical-session.target.Changes
bin/omarchy-audio-inhibit: Lightweight event-driven daemon with ownership tracking, user-dismissal suppression, and--status/--onceCLI inspection modes.default/systemd/user/omarchy-audio-inhibit.service: Systemd user service unit running under graphical sessions.install/user/first-run/enable-user-units.sh: Enabled during first-run user setup.test/shell.d/audio-inhibit-test.sh: Automated unit test suite verifying stream detection, stay-awake ownership, user-dismissal suppression, session lock release, and automatic reset on playback end.Verification
test/shell.d/audio-inhibit-test.shpasses (8/8 assertions)../test/clipasses (107/107 assertions).