parkerlreed

pianobar

Apr 13th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.80 KB | None | 0 0
  1. Requires curl
  2.  
  3. mkdir ~/.config/pianobar
  4.  
  5. The following goes in ~/.config/pianobar/config (Leave the tls line in there)
  6. -----------------------------------------------
  7. password = password
  8. tls_fingerprint = 2D0AFDAFA16F4B5C0A43F3CB1D4752F9535507C0
  9. event_command = ~/bin/pianobar-conky
  10. -----------------------------------------------
  11.  
  12. The following goes in ~/bin/pianobar-conky (The notify-send line is optional. Used for visual notifications)
  13. -----------------------------------------------
  14. #!/bin/bash
  15.  
  16. # create variables
  17. while read L; do
  18. k="`echo "$L" | cut -d '=' -f 1`"
  19. v="`echo "$L" | cut -d '=' -f 2`"
  20. export "$k=$v"
  21. done < <(grep -e '^\(title\|artist\|album\|stationName\|songStationName\|pRet\|pRetStr\|wRet\|wRetStr\|songDuration\|songPlayed\|rating\|coverArt\|stationCount\|station[0-9]*\)=' /dev/stdin) # don't overwrite $1...
  22.  
  23. case "$1" in
  24. songstart)
  25. curl -s -4 -o ~/.config/pianobar/coverArt.jpg "$coverArt"
  26. echo -n "$title"> ~/.config/pianobar/title
  27. echo -n "$album" > ~/.config/pianobar/album
  28. echo -n "$artist" > ~/.config/pianobar/artist
  29. notify-send -i ~/.config/pianobar/coverArt.jpg "Pianobar - $stationName" "Now Playing: $artist - $title"
  30. ;;
  31.  
  32. esac
  33. -----------------------------------------------
  34.  
  35. The following goes in ~/.conkyrc (Change wlan0 to eth0 if you are using wired internet)
  36. -----------------------------------------------
  37. background yes
  38. use_xft yes
  39. xftfont Sans:size=8
  40. xftalpha 1
  41. update_interval 1.0
  42. total_run_times 0
  43. own_window yes
  44. own_window_transparent yes
  45. own_window_type desktop
  46. own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
  47. double_buffer yes
  48. minimum_size 1000 1000
  49. maximum_width 200
  50. draw_shades yes
  51. draw_outline no
  52. draw_borders no
  53. draw_graph_borders yes
  54. default_color white
  55. default_shade_color black
  56. default_outline_color white
  57. alignment top_right
  58. gap_x 12
  59. gap_y 44
  60. no_buffers yes
  61. uppercase no
  62. cpu_avg_samples 2
  63. override_utf8_locale no
  64. imlib_cache_size 0
  65.  
  66. TEXT
  67. ${color #D8D8D8}${font sans-serif:bold:size=8}SYSTEM ${hr 2}
  68. ${font sans-serif:normal:size=8}$sysname $kernel $alignr $machine
  69. Host:$alignr$nodename
  70. Uptime:$alignr$uptime
  71. File System: $alignr${fs_type}
  72.  
  73. ${font sans-serif:bold:size=8}PROCESSORS ${hr 2}
  74. ${font sans-serif:normal:size=8}${cpugraph cpu1}
  75. CPU1: ${cpu cpu1}% ${cpubar cpu1}
  76.  
  77. ${font sans-serif:bold:size=8}MEMORY ${hr 2}
  78. ${font sans-serif:normal:size=8}RAM $alignc $mem / $memmax $alignr $memperc%
  79. $membar
  80.  
  81. ${font sans-serif:bold:size=8}DISKS ${hr 2}
  82. ${font sans-serif:normal:size=8}/ $alignc ${fs_used /} / ${fs_size /} $alignr ${fs_used_perc /}%
  83. ${fs_bar /}
  84.  
  85. ${font sans-serif:bold:size=8}TOP PROCESSES ${hr 2}
  86. ${font sans-serif:normal:size=8}${top_mem name 1}${alignr}${top mem 1} %
  87. ${top_mem name 2}${alignr}${top mem 2} %
  88. $font${top_mem name 3}${alignr}${top mem 3} %
  89. $font${top_mem name 4}${alignr}${top mem 4} %
  90. $font${top_mem name 5}${alignr}${top mem 5} %
  91.  
  92. ${font sans-serif:bold:size=8}NETWORK ${hr 2}
  93. ${font sans-serif:normal:size=8}IP address: $alignr ${addr wlan0}
  94. ESSID: $alignr ${wireless_essid wlan0}
  95. Connection quality: $alignr ${wireless_link_qual_perc wlan0}%
  96. ${downspeedgraph wlan0}
  97. DLS:${downspeed wlan0} kb/s $alignr total: ${totaldown wlan0}
  98. ${upspeedgraph wlan0}
  99. ULS:${upspeed wlan0} kb/s $alignr total: ${totalup wlan0}
  100.  
  101. ${font sans-serif:bold:size=8}PIANOBAR ${hr 2}
  102. ${font sans-serif:normal:size=8}Title: $alignr ${exec cat ~/.config/pianobar/title}
  103. Artist: $alignr ${exec cat ~/.config/pianobar/artist}
  104. Album: $alignr ${exec cat ~/.config/pianobar/album}
  105. ${image ~/.config/pianobar/coverArt.jpg -p 40,570 -s 160x160}
  106. #${font sans-serif:bold:size=8}SPOTIFY ${hr 2}
  107. #${font sans-serif:normal:size=8}Title: $alignr ${exec spotititle}
  108. #Artist: $alignr ${exec spotiartist}
  109. #Album: $alignr ${exec spotialbum}
  110. -----------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment