Advertisement
parkerlreed

pianobar

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