aboutsummaryrefslogtreecommitdiff
path: root/Scripts/.local/scripts/status/volume
blob: c3de64cb6663bf341b6431748e96b1b024fed99b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash
sinks="$(pactl list sinks)"
vol="$(echo "$sinks" | grep '[0-9]\+%' | sed "s,.* \([0-9]\+\)%.*,\1,;1q")"
mpc_vol="$($HOME/.local/scripts/mpc_volume)"

if [[ $vol -gt 50 ]]
then
    icon=""
elif [[ $vol -gt 10 ]]
then
    icon=""
else
    icon=""
fi

if [[ $mpc_vol == "n/a" ]]
then
    echo "$icon $vol%"
else
    echo "$icon $vol% $mpc_vol%"
fi