From: Mike Frysinger Date: Sat, 12 Nov 2011 06:41:53 +0000 (-0500) Subject: add helper for vlc shortcuts X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=5f25a449b106bc1c35d5930b925dae337d41ef22;p=home.git add helper for vlc shortcuts --- diff --git a/.bin/vlc-rc b/.bin/vlc-rc new file mode 100755 index 0000000..f52e6cf --- /dev/null +++ b/.bin/vlc-rc @@ -0,0 +1,35 @@ +#!/bin/bash + +exec 3<> /dev/tcp/vapier/8001 +send() { echo "$*" 1>&3 ; } +recv() { local l; read l <&3; echo ${l%$'\r'} ; } + +case $1 in +f|fullscreen) + send f $2 + ;; +help) + send $1 + cat <&3 + ;; +pause|quit) + send $1 + ;; +vol) + shift + send vol$* + ;; +seek) + off=( 0 5 15 30 60 ) + [[ -z $2 || -n ${2//[-+]} ]] && exit 0 + off=${off[${#2}]} + send get_time + curr=$(recv) + send seek $(( curr ${2:0:1} off )) + ;; +*) + send "$@" + ;; +esac + +exit 0