From: Mike Frysinger Date: Wed, 26 Sep 2012 04:24:04 +0000 (-0400) Subject: make vol up/down work X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=1536c1f24d06e4904474bdd1e3722eba5fe428f5;p=home.git make vol up/down work --- diff --git a/.bin/vlc-rc b/.bin/vlc-rc index 60493bf..04a48d2 100755 --- a/.bin/vlc-rc +++ b/.bin/vlc-rc @@ -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