#!/usr/bin/awk -f BEGIN { cmd="amixer -D pipewire sget Master" FS="[][]" while (cmd | getline) { if (NF > 1) { vol=int($2) if ($4 == "off") icon="񂁳" else if (vol > 70) icon="񂁲" else if (vol > 40) icon="񂁱" else if (vol > 10) icon="񂁰" else icon="񂁯" #printf "%s %s | %05.2fdB", icon, $2, $4 print icon" "$2 } } } ##!/bin/sh ##amixer sget Master | awk -F'[][]' '/%/{print $2" | "$4 " [" $6 "]"}' #amixer -M sget Master | sed -n 's/.*Playback [0-9]* \[//; s/. ./ | /; s/\] .off\]/ \[mute\]/p; s/\] .on.//p'