~dricottone/my-utils

ref: 598fcd5f3c9242b5f38809c982c7ca9045c33857 my-utils/src/pactl-volume-printf -rwxr-xr-x 233 bytes
598fcd5fDominic Ricottone Added wg*, fw*, docker*, android*, pactl*, vimsplit; Update to enumerate 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

volumes=$(pactl list sinks \
  | grep -F 'Volume:' \
  | grep -o -e '[0-9]\+%' \
  | head -n 2)

if [ $# -ge 1 ]; then
  format="$1"
else
  format="%s/%s\n"
fi

if [ ! -z "$volumes" ]; then
  printf "$format" $volumes
fi