Created
November 13, 2012 02:54
-
-
Save r35krag0th/4063675 to your computer and use it in GitHub Desktop.
A cleaner PianoBar Controller; incomplete
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
ControlFile="$HOME/.config/pianobar/ctl" | |
IssueCommand() { | |
CommandToIssue=$1 | |
#echo "Sending '$CommandToIssue'..." | |
echo -n $CommandToIssue > $ControlFile | |
} | |
case $1 in | |
p|pause|play) | |
IssueCommand 'p' | |
;; | |
love|l|+|up|thumbup) | |
IssueCommand '+' | |
;; | |
hate|ban|-|down|thumbdown) | |
IssueCommand '-' | |
;; | |
next|n) | |
IssueCommand 'n' | |
;; | |
tired|t) | |
IssueCommand 't' | |
;; | |
stop|quit|q) | |
IssueCommand 'q' | |
;; | |
exlain|e) | |
IssueCommand 'e' | |
;; | |
nextstation|ns) | |
IssueCommand 'ns' | |
;; | |
prevstation|previosstation|ps) | |
IssueCommand 'ps' | |
;; | |
switchstation|ss|switch) | |
IssueCommand 'ss' | |
## EXTRA LOGIC | |
;; | |
upcoming|queue|u) | |
IssueCommand 'u' | |
;; | |
history|h) | |
IssueCommand 'h' | |
;; | |
*) | |
echo 'Valid Commands: p/+/-/n/t/q/e/ns/ps/ss/u/h'; | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment