https://github.com/vollowx/wp-swayidle
A program that manages swayidle depending on audio output
https://github.com/vollowx/wp-swayidle
c pipewire swayidle wireplumber
Last synced: 9 months ago
JSON representation
A program that manages swayidle depending on audio output
- Host: GitHub
- URL: https://github.com/vollowx/wp-swayidle
- Owner: vollowx
- License: mit
- Created: 2025-07-31T07:32:54.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-07-31T13:21:44.000Z (10 months ago)
- Last Synced: 2025-07-31T16:39:21.082Z (10 months ago)
- Topics: c, pipewire, swayidle, wireplumber
- Language: C
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wp-swayidle
A program that manages swayidle depending on audio output.
If any active stream is detected, swayidle will be stopped, if not, swayidle
will be re-spawned. Only the swayidle instance spawned by wp-swayidle will be
stopped.
Originally, I wrote this program because it's hard to pause swayidle on all the
occasions that I do not want my screen suddenly been locked, like when I am
watching a video in a browser that is not in fullscreen, playing games that are
not listed in the `for_window` rules in Sway, or just listening to music hosted
by `mpd`. By just checking if there is any audio output, almost all the
occasions are covered.
## Dependencies
### Runtime Dependencies
- swayidle
### Build Dependencies
- meson
- ninja
- GCC or compatible C compiler
- wireplumber
- pipewire
## Installation
meson setup build
ninja -C build
sudo ninja -C build install
## Usage
wp-swayidle [-- ...]
For example in `~/.config/sway/config`:
exec swayidle -w before-sleep 'swaylock'
exec wp-swayidle 3 -- timeout 300 'swaylock' \
timeout 600 'swaymsg "output * power off"' \
resume 'swaymsg "output * power on"'