Guest User

status.sh

a guest
Nov 28th, 2011
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.57 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. RED="\\#D7875F\\"
  4. GREEN="\\#81E234\\"
  5. YELLOW="\\#DFAF8F\\"
  6. BLUE="\\#729CFC\\"
  7. MAUVE="\\#AD7FA8\\"
  8. WHITE="\\#BEBEBE\\"
  9. DEFAULT="\\#BEBEBE\\"
  10.  
  11. mpd=$(ncmpcpp --now-playing | awk '/:/ {print$0}')
  12. date=$(date "+%H:%M - %a %d %b")
  13.  
  14. statustext ()
  15. {
  16.     wmfs -s "$GREEN mpd: $mpd$DEFAULT | $BLUE$date$DEFAULT"
  17. }
  18.  
  19. processchecker=$(ps U $UID | awk '{print $5}' | grep ^wmfs$)
  20.  
  21. if [ "$processchecker" = "wmfs" ]; then
  22.     while true
  23.         do statustext
  24.         sleep 10
  25.     done
  26. else
  27.     kill $(ps U $UID | awk '/status.sh/' | grep -vi "$$\|grep\|awk" | awk '{print $1}')
  28. fi
  29.  
Advertisement
Add Comment
Please, Sign In to add comment