summaryrefslogtreecommitdiffstats
path: root/bin/volume
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2017-10-30 03:16:12 -0400
committerJesse Luehrs <doy@tozt.net>2017-10-30 04:39:37 -0400
commit02e929e0cd229411fa5e0b55dd1098159ab1428a (patch)
tree738f1784b4889c5578db245a479b5219a1a682ac /bin/volume
parentb6f8209a55cec66cfd206cd3bc278f5c97edbb9e (diff)
downloadconf-02e929e0cd229411fa5e0b55dd1098159ab1428a.tar.gz
conf-02e929e0cd229411fa5e0b55dd1098159ab1428a.zip
fix volnoti when setting volume above 100%
Diffstat (limited to 'bin/volume')
-rwxr-xr-xbin/volume2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/volume b/bin/volume
index d1e65b7..1a478c7 100755
--- a/bin/volume
+++ b/bin/volume
@@ -15,7 +15,7 @@ case $1 in
esac
INFO=$(pacmd dump | grep analog-stereo)
-VOLUME=$(echo "$INFO" | grep 'set-sink-volume' | cut -d' ' -f 3 | perl -e'print 100*oct(<>)/0x10000')
+VOLUME=$(echo "$INFO" | grep 'set-sink-volume' | cut -d' ' -f 3 | perl -e'my $vol = 100*oct(<>)/0x10000; print $vol > 100 ? 100 : $vol')
STATE=$(echo "$INFO" | grep 'set-sink-mute' | cut -d' ' -f 3)
if [[ "x$STATE" == "xyes" ]]; then
volnoti-show -m