summaryrefslogtreecommitdiff
path: root/contrib/eventcmd.sh
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2010-03-05 12:50:05 +0100
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2010-03-06 10:55:52 +0100
commitb4596758a71d3a4751a90737e4373a06aa558ffc (patch)
treef0d7873839736508ab6ccb29659c1340eca1c7e2 /contrib/eventcmd.sh
parented2240e0990236bf50d795ac86a2dfad05e1a086 (diff)
downloadpianobar-windows-b4596758a71d3a4751a90737e4373a06aa558ffc.tar.gz
pianobar-windows-b4596758a71d3a4751a90737e4373a06aa558ffc.tar.bz2
pianobar-windows-b4596758a71d3a4751a90737e4373a06aa558ffc.zip
Example eventcmd script updated
Diffstat (limited to 'contrib/eventcmd.sh')
-rwxr-xr-xcontrib/eventcmd.sh28
1 files changed, 21 insertions, 7 deletions
diff --git a/contrib/eventcmd.sh b/contrib/eventcmd.sh
index a857afd..7a9ad49 100755
--- a/contrib/eventcmd.sh
+++ b/contrib/eventcmd.sh
@@ -5,16 +5,30 @@ while read L; do
k="`echo "$L" | cut -d '=' -f 1`"
v="`echo "$L" | cut -d '=' -f 2`"
export "$k=$v"
-done < <(grep -e '^\(title\|artist\|album\|stationName\|pRet\|pRetStr\)=' /dev/stdin) # don't overwrite $1...
+done < <(grep -e '^\(title\|artist\|album\|stationName\|pRet\|pRetStr\|songDuration\|songPlayed\|rating\)=' /dev/stdin) # don't overwrite $1...
case "$1" in
- songstart)
- #echo 'naughty.notify({title = "pianobar", text = "Now playing: ' "$title" ' by ' "$artist" '"})' | awesome-client -
- #echo "$title -- $artist" > $HOME/.config/pianobar/nowplaying
- # or whatever you like...
- ;;
+# songstart)
+# echo 'naughty.notify({title = "pianobar", text = "Now playing: ' "$title" ' by ' "$artist" '"})' | awesome-client -
+# echo "$title -- $artist" > $HOME/.config/pianobar/nowplaying
+# # or whatever you like...
+# ;;
+
+# songfinish)
+# # scrobble if 75% of song have been played, but only if the song hasn't
+# # been banned
+# if [ -n "$songDuration" ] &&
+# [ $(echo "scale=4; ($songPlayed/$songDuration*100)>50" | bc) -eq 1 ] &&
+# [ "$rating" -ne 2 ]; then
+# # scrobbler-helper is part of the Audio::Scrobble package at cpan
+# # "pia" is the last.fm client identifier of "pianobar", don't use
+# # it for anything else, please
+# scrobbler-helper -P pia -V 1.0 "$title" "$artist" "$album" "" "" "" "$((songDuration/1000))" &
+# fi
+# ;;
+
*)
- if [ $pRet -ne 0 ]; then
+ if [ "$pRet" -ne 1 ]; then
echo "naughty.notify({title = \"pianobar\", text = \"$1 failed: $pRetStr\"})" | awesome-client -
fi
;;