summaryrefslogtreecommitdiff
path: root/i3blocks-audio.sh
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2020-05-14 17:35:21 -0400
committerAdam T. Carpenter <atc@53hor.net>2020-05-14 17:35:21 -0400
commit680a167d6f72853eeab01970426028fc474c6005 (patch)
tree8125abf3f5cc3ccb7c7ec8960854ab3992d3ae21 /i3blocks-audio.sh
parenta9ca605132e22b5bb7ab1bf67ebbcfa1e0a0c0d2 (diff)
downloadscripts-680a167d6f72853eeab01970426028fc474c6005.tar.xz
scripts-680a167d6f72853eeab01970426028fc474c6005.zip
added net, updated audio for FreeBSD, removed title blocks
Diffstat (limited to 'i3blocks-audio.sh')
-rwxr-xr-xi3blocks-audio.sh7
1 files changed, 3 insertions, 4 deletions
diff --git a/i3blocks-audio.sh b/i3blocks-audio.sh
index 84f883d..53b00e3 100755
--- a/i3blocks-audio.sh
+++ b/i3blocks-audio.sh
@@ -7,11 +7,10 @@ icon_mid=󰖀
icon_high=󰕾
icon_mute=󰝟
-[ $(pulsemixer --get-mute) -eq 1 ] && printf "$icon_mute\n" && exit
-
-volume=$(pulsemixer --get-volume | cut -d' ' -f1)
+volume=$(mixer vol | cut -d':' -f2)
icon=
-[ $volume -lt $low ] && icon=$icon_low
+[ $volume -eq 0 ] && icon=$icon_mute
+[ $volume -gt 0 ] && [ $volume -lt $low ] && icon=$icon_low
[ $volume -ge $low ] && [ $volume -lt $high ] && icon=$icon_mid
[ $volume -ge $high ] && icon=$icon_high
printf "%s %s%%\n" $icon $volume