blob: 4a4b4a87d5f4a800d2e45bedb7256f455844691c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#!/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'
|