Advertisement
Guest User

Dzen2-config

a guest
Mar 30th, 2014
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.76 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #=== Settings ===#
  4. SLEEP=0.1
  5.  
  6. speaker_icon="^i($HOME/.dzen/icons/spkr_01.xbm)"
  7. mpd_icon="^i($HOME/.dzen/icons/mpd.xbm)"
  8.  
  9.  
  10. #=== Loop ===#
  11. while :; do
  12.  
  13. # volume
  14. playback=$(amixer get Master | sed -rn '$s/[^[]+\[([0-9]+%).*/\1/p')
  15.  
  16. if [ $playback == "0%" ]
  17. then
  18. playback_format="000%"
  19. elif [ $playback == "100%" ]
  20. then
  21. playback_format="${color_main}100%"
  22. else
  23. playback_format=$(printf "%04s" $playback | sed "s/ /0/g;s/\(^0\+\)/\1${color_main}/")
  24. fi
  25.  
  26. volume="${color_sec1}${speaker_icon} ${color_sec2}${playback_format}"
  27.  
  28. # mpd
  29.  mpc_current=$(mpc current | sed 's/AnimeNfo Radio | Serving you the best Anime and Doujin music!: //')
  30.  
  31. mpd="${color_sec1}${mpd_icon} ${color_main}${mpc_current}"
  32.  
  33. echo " $volume  $mpd"
  34.  
  35. sleep $SLEEP; done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement