Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Flora Listening by LeaskH.com
- initFlora() {
- export PATH=~/Documents/.flora:$PATH
- }
- getLastListening() {
- echo `cat /tmp/flora_listening 2> /dev/null`
- }
- setLastListening() {
- echo "$*" > /tmp/flora_listening
- }
- getCurListening() {
- echo "`itunes status | sed -n 2p`"
- }
- # Main logic
- initFlora
- current="`getCurListening`"
- if [ "$1" = 's' ]; then
- if [ ! "`getLastListening`" = "$current" ]; then
- notify $current
- # itunes lyric
- fi
- else
- notify $current
- # itunes lyric
- fi
- setLastListening $current
- exit 0;
Add Comment
Please, Sign In to add comment