]> git.wh0rd.org Git - home.git/commitdiff
make vol up/down work
authorMike Frysinger <vapier@gentoo.org>
Wed, 26 Sep 2012 04:24:04 +0000 (00:24 -0400)
committerMike Frysinger <vapier@gentoo.org>
Wed, 26 Sep 2012 04:24:04 +0000 (00:24 -0400)
.bin/vlc-rc

index 60493bf6dceb487e7779416dc6d5666189cdb000..04a48d20d8a631e732a508ff81f6750ff2c0926b 100755 (executable)
@@ -31,7 +31,20 @@ pause|quit|next|prev)
        ;;
 vol)
        shift
-       send vol$*
+       send volume
+       curr=$(recv)
+       lvl=${2:-10}
+       case ${curr} in
+       # status change: ( audio volume: 115 )
+       "status change"*"audio volume"*)
+               vol=$(echo "${curr}" | awk '{ print $(NF-1) }')
+               case $1 in
+               up)   : $(( vol += lvl )) ;;
+               down) : $(( vol -= lvl )) ;;
+               esac
+               send volume ${vol}
+               ;;
+       esac
        ;;
 seek)
        if [[ -n $2 && -z ${2//[-+]} ]] ; then