5
k="`echo "$L" | cut -d '=' -f 1`"
6
v="`echo "$L" | cut -d '=' -f 2`"
8
done < <(grep -e '^\(title\|artist\|album\|stationName\|pRet\|pRetStr\|wRet\|wRetStr\|songDuration\|songPlayed\|rating\|coverArt\|stationCount\|station[0-9]*\)=' /dev/stdin) # don't overwrite $1...
12
# echo 'naughty.notify({title = "pianobar", text = "Now playing: ' "$title" ' by ' "$artist" '"})' | awesome-client -
13
# echo "$title -- $artist" > $HOME/.config/pianobar/nowplaying
14
# # or whatever you like...
18
# # scrobble if 75% of song have been played, but only if the song hasn't
20
# if [ -n "$songDuration" ] &&
21
# [ $(echo "scale=4; ($songPlayed/$songDuration*100)>50" | bc) -eq 1 ] &&
22
# [ "$rating" -ne 2 ]; then
23
# # scrobbler-helper is part of the Audio::Scrobble package at cpan
24
# # "pia" is the last.fm client identifier of "pianobar", don't use
25
# # it for anything else, please
26
# scrobbler-helper -P pia -V 1.0 "$title" "$artist" "$album" "" "" "" "$((songDuration/1000))" &
31
if [ "$pRet" -ne 1 ]; then
32
echo "naughty.notify({title = \"pianobar\", text = \"$1 failed: $pRetStr\"})" | awesome-client -
33
elif [ "$wRet" -ne 1 ]; then
34
echo "naughty.notify({title = \"pianobar\", text = \"$1 failed: Network error: $wRetStr\"})" | awesome-client -