prism-audio-status
Deprecated
This script is considered legacy code. It was previously used to drive the volume widget in the Eww status bar but has been superseded by prism-audio-mixer and a QuickShell integrations.
A lightweight monitoring script that outputs the current default sink's volume and mute status as a JSON object. It was designed to provide icon-based feedback (high, medium, low, muted) for status bar widgets.
How it works
- Initial State: Queries
pactlto determine the current volume percentage and mute status of the default audio sink. - Icon Logic:
- Muted: Returns "" with a "muted" class.
- > 50%: Returns "" (High volume).
- > 25%: Returns "" (Medium volume).
- < 25%: Returns "" (Low volume).
- Event Loop: It subscribes to PulseAudio events using
pactl subscribe. Whenever a "sink" event occurs (volume change, mute toggle), it outputs a new JSON line with the updated status.
Dependencies
pulseaudio: Providespactl.gnugrep: For filtering volume data.coreutils: Standard utilities.
Usage
This script outputs a continuous stream of JSON objects to stdout.
prism-audio-status
Output format
{"icon": "", "percent": 75, "class": ""}