#!/bin/sh # Display volume level (requires amixer/alsa) if ! command -v amixer >/dev/null 2>&1; then printf "N/A" exit 0 fi amixer get Master 2>/dev/null | awk -F'[][]' '/Playback.*%/ { vol = $2 mute = $4 if (mute == "off") { printf "VOL MUTE" } else { printf "VOL %s", vol } exit }'