Guest User

Untitled

a guest
May 20th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #!/bin/sh
  2. # Flora Listening by LeaskH.com
  3.  
  4. initFlora() {
  5. export PATH=~/Documents/.flora:$PATH
  6. }
  7.  
  8. getLastListening() {
  9. echo `cat /tmp/flora_listening 2> /dev/null`
  10. }
  11.  
  12. setLastListening() {
  13. echo "$*" > /tmp/flora_listening
  14. }
  15.  
  16. getCurListening() {
  17. echo "`itunes status | sed -n 2p`"
  18. }
  19.  
  20. # Main logic
  21. initFlora
  22. current="`getCurListening`"
  23. if [ "$1" = 's' ]; then
  24. if [ ! "`getLastListening`" = "$current" ]; then
  25. notify $current
  26. # itunes lyric
  27. fi
  28. else
  29. notify $current
  30. # itunes lyric
  31. fi
  32. setLastListening $current
  33. exit 0;
Add Comment
Please, Sign In to add comment