From 5f25a449b106bc1c35d5930b925dae337d41ef22 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 12 Nov 2011 01:41:53 -0500 Subject: [PATCH] add helper for vlc shortcuts --- .bin/vlc-rc | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 .bin/vlc-rc 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 -- 2.39.5