From 1536c1f24d06e4904474bdd1e3722eba5fe428f5 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 26 Sep 2012 00:24:04 -0400 Subject: [PATCH] make vol up/down work --- .bin/vlc-rc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 -- 2.39.5