1. [zandi@laptop ~]$ cat ~/.conkyrc && cat ./battery.sh
  2. # Conky script modified for use on SONY Playstation 3 running YDL 6, using screen mode for 720p televisions.
  3. # Best used with Fluxbox Window Manager.
  4. # Please feel free to modify to your own needs.
  5.  
  6. # UBUNTU-CONKY
  7. # A comprehensive conky script, configured for use on
  8. # Ubuntu / Debian Gnome, without the need for any external scripts.
  9. #
  10. # Based on conky-jc and the default .conkyrc.
  11. # INCLUDES:
  12. # - tail of /var/log/messages
  13. # - netstat connections to your computer
  14. #
  15. # -- Pengo (conky@pengo.us)
  16. #
  17.  
  18. # Create own window instead of using desktop (required in nautilus)
  19. own_window yes
  20. own_window_type dock
  21. own_window_argb_visual no
  22. #own_window_argb_value 0
  23. own_window_transparent yes
  24. own_window_hints sticky,skip_taskbar,skip_pager
  25. #minimum_size 1024 0
  26.  
  27. #only consider an interface "up" if it has a link.
  28. if_up_strictness link
  29.  
  30. double_buffer yes
  31. use_spacer none
  32. use_xft yes
  33. update_interval 2.0
  34. #maximum_width 1024
  35.  
  36. # Text stuff
  37. draw_outline yes # amplifies text if yes
  38. draw_borders no
  39. uppercase no # set to yes if you want all text to be in uppercase
  40.  
  41. xftfont Bitstream Vera Sans Mono:size=8
  42. xftalpha 1
  43. # Stippled borders?
  44. #stippled_borders 1
  45. #border_width 1
  46. #border_inner_margin 1
  47.  
  48. alignment bottom_center
  49.  
  50. #Default colors and also border colors, grey90 == #e5e5e5
  51. #default_color 6a6a6a
  52. #color1 2525a1
  53. default_color white
  54. color1 CCCCCC
  55.  
  56. # Gap between borders of screen and text
  57. gap_x 3
  58. gap_y 3
  59.  
  60. TEXT
  61. ${color1}${hr}
  62. ${color1}CPU:${color}${cpubar 5,20} ${cpu}% ${color1}RAM:${color}${membar 5,20} ${memperc}% ${color1}SWAP:${color}${swapperc}% ${color1}BATT:${execpi 4.0 ./battery.sh}${battery_bar 5,20 BAT0} ${battery_percent BAT0}% ${color1}TEMP:${color}${acpitemp}C${if_gw} ${color1}GW:${color}${gw_ip}${endif} ${if_up wlan0}${color1}wlan0:${color}${wireless_essid wlan0} ${addr wlan0} ${wireless_link_bar 5,20 wlan0}${endif}${if_up wlan1} ${color1}wlan1:${color}${wireless_essid wlan1} ${addr wlan1} ${wireless_link_bar 5,20 wlan1}${endif}${if_up eth0} ${color1}eth0:${color}${addr eth0}${endif} ${color1}Volume:${color}${mixer} ${color1}TCP:${color}${tcp_portmon 1 65535 count}
  63.  
  64.  
  65. #!/bin/bash
  66. percentage=`acpitool | awk '/Battery/ { print $5; }' | cut --delimiter=. -f 1`
  67. color='${color}'
  68. #echo $percentage
  69.  
  70.  
  71.  
  72. if [ "$percentage" -le 10 ]
  73. then
  74. color='${color #FF0000'}
  75. fi
  76. if [ "$percentage" -le 30 ]
  77. then
  78. color='${color #FFFF00}'
  79. fi
  80.  
  81. echo $color