I finally was able to make my conky check for usb drives with variable mountpoints. Now no matter where a usb stick gets mounted as long as it is sda[1,2], it will show up with the right moutpoint displayed in conky. I'm sure this can be improved on, and if anyone can make it better, by all means, post it. Thanks to [tt]awk[/tt], everything works like I want it to. So far.
Highlights Include:
upload/download blocks change for wired or wireless
IP line also changes depending on wired/wifi state
power plug indicator green/red for in/out
sdb1 and sdb2 for usb disks displays correct variable mountpoint
disk usage update during copy not after transaction
Code:
# UBUNTU-CONKY
# A comprehensive conky script, configured for use on
# Ubuntu / Debian Gnome, without the need for any external scripts.
#
# Based on conky-jc and the default .conkyrc.
# INCLUDES:
# - tail of /var/log/messages
# - netstat connections to your computer
#
# -- Pengo (conky@pengo.us)
#
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
background yes #Transparent background.
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# fiddle with window
use_spacer right
use_xft yes
# Update interval in seconds
update_interval .5
# Minimum size of text area
minimum_size 410 660
# Draw shades?
draw_shades no
# Draw borders around graphs
draw_graph_borders no
# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
xftfont Eurostile:size=10
xftalpha 0.7
#font arial
uppercase no # set to yes if you want all text to be in uppercase
# Stippled borders?
stippled_borders 3
# border margins
border_margin 9
# border width
border_width 10
# Default colors and also border colors, grey90 == #e5e5e5
#default_color #E0D19B
own_window_colour brown
own_window_transparent yes
# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right
# Gap between borders of screen and text
gap_x 5
gap_y 5
#colors
color0 0077ff
# stuff after 'TEXT' will be formatted on screen
TEXT
${font DejaVu Sans Mono:size=9}${color #0077ff}${exec cat /etc/elive-version |grep elive-version} ${goto 220}Uptime: ${color}$uptime
${color #0077ff}$kernel ${goto 220}${color #0077ff}Battery: ${if_existing /sys/class/power_supply/ACAD/online 0}${color}${battery_percent}% ${color #0077ff}Plug: ${color #ff5555}out${else}${endif}${if_existing /sys/class/power_supply/ACAD/online 1}${color}${battery_percent}% ${color #0077ff}Plug: ${color #55ff55}in${endif}
${color #0077ff}Core 0: ${color}${cpu cpu0}% ${color #0077ff}${cpubar cpu0 5}
${color #0077ff}Core 1: ${color}${cpu cpu1}% ${color #0077ff}${cpubar cpu1 5}
${color #0077ff}Disk Usage${goto 120}|RAM Usage${goto 220}|Down Speed${goto 320}|Up Speed
${color}${diskio}${color #0077ff}${goto 120}|${color}${mem}${color #0077ff}${goto 220}|${color}${if_existing /proc/net/route ath0}${downspeed ath0}${else}${endif}${if_existing /proc/net/route eth0}${downspeed eth0}${else}${endif}${goto 320}${color #0077ff}|${color}${if_existing /proc/net/route ath0}${upspeed ath0}${else}${endif}${if_existing /proc/net/route eth0}${upspeed eth0}${else}${endif}
${color #0077ff} ${diskiograph 13,100 0077ff 0077ff 500}${goto 120}|${color}${memperc}% ${color #0077ff}${memgraph 13,50 0077ff 0077ff}${goto 220}|${if_existing /proc/net/route ath0}${downspeedgraph ath0 13,90 0077ff 0077ff 7000}${else}${endif}${if_existing /proc/net/route eth0}${downspeedgraph eth0 13,90 0077ff 0077ff 7000}${color #0077ff}${else}${endif}${goto 320}|${if_existing /proc/net/route ath0}${upspeedgraph ath0 13,90 0077ff 0077ff 2000}${else}${endif}${if_existing /proc/net/route eth0}${upspeedgraph eth0 13,90 0077ff 0077ff 2000}${else}${endif}
${if_existing /proc/net/route eth0}${color #0077ff}Wired:${color} ${addr eth0}${else}${endif}${if_existing /proc/net/route ath0}${color #0077ff}WiFi:${color} ${addr ath0} ${goto 190}${wireless_link_qual_perc ath0}% ${color #0077ff}${wireless_link_bar 5,50 ath0} ${color}${wireless_essid ath0}${else}${endif}
${color #0077ff}File systems:
${color #0077ff}Mount Point Free Total Used
${color #0077ff}/ ${goto 130}${color}${exec df -h |grep /dev/sda3 |awk '{print $4 " " $2 " " $5}'} ${goto 300}${color #0077ff}${fs_bar 4 /}
${color #0077ff}/home ${goto 130}${color}${exec df -h |grep /dev/sda4 |awk '{print $4 " " $2 " " $5}'} ${goto 300}${color #0077ff}${fs_bar 4 /home}
${color #0077ff}${if_existing /etc/mtab /dev/sdb1}${exec mount |grep /dev/sdb1 |awk '{print $3}'} ${goto 130}${color}${exec df -h |grep /dev/sdb1 |awk '{print $4 " " $2 " " $5}'} ${goto 300}${color #0077ff}${execbar df |grep /dev/sdb1 |awk '{print $5*.01}'}
${else}${endif}${color #0077ff}${if_existing /etc/mtab /dev/sdb2}${exec mount |grep /dev/sdb2 |awk '{print $3}'} ${goto 130}${color}${exec df -h |grep /dev/sdb2 |awk '{print $4 " " $2 " " $5}'} ${goto 300}${color #0077ff}${execbar df |grep /dev/sdb2 |awk '{print $5*.01}'}
${else}${endif}
${color #0077ff}Top Processes:
${color #0077ff}CPU time ${alignr}PID CPU% MEM%
${color #ffffff} ${top name 1}${alignr}${top pid 1} ${top cpu 1} ${top mem 1}
${color #eeeeee} ${top name 2}${alignr}${top pid 2} ${top cpu 2} ${top mem 2}
${color #dddddd} ${top name 3}${alignr}${top pid 3} ${top cpu 3} ${top mem 3}
${color #cccccc} ${top name 4}${alignr}${top pid 4} ${top cpu 4} ${top mem 4}
${color #bbbbbb} ${top name 5}${alignr}${top pid 5} ${top cpu 5} ${top mem 5}
${color #0077ff}MEM usage
${color #ffffff} ${top_mem name 1}${alignr}${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1}
${color #eeeeee} ${top_mem name 2}${alignr}${top_mem pid 2} ${top_mem cpu 2} ${top_mem mem 2}
${color #dddddd} ${top_mem name 3}${alignr}${top_mem pid 3} ${top_mem cpu 3} ${top_mem mem 3}
${color #cccccc} ${top_mem name 4}${alignr}${top_mem pid 4} ${top_mem cpu 4} ${top_mem mem 4}
${color #bbbbbb} ${top_mem name 5}${alignr}${top_mem pid 5} ${top_mem cpu 5} ${top_mem mem 5}
${color #0077ff}Port Monitor${alignr}${color}${tcp_portmon 1 65535 count} ${color #0077ff}Total Connections
${color #0077ff}Inbound - ${color}${tcp_portmon 1 32767 count} ${alignr} ${color #0077ff}Local Service/Port${color}
${tcp_portmon 1 32767 rhost 0} ${alignr} ${tcp_portmon 1 32767 lservice 0}
${tcp_portmon 1 32767 rhost 1} ${alignr} ${tcp_portmon 1 32767 lservice 1}
${tcp_portmon 1 32767 rhost 2} ${alignr} ${tcp_portmon 1 32767 lservice 2}
${tcp_portmon 1 32767 rhost 3} ${alignr} ${tcp_portmon 1 32767 lservice 3}
${tcp_portmon 1 32767 rhost 4} ${alignr} ${tcp_portmon 1 32767 lservice 4}
${tcp_portmon 1 32767 rhost 5} ${alignr} ${tcp_portmon 1 32767 lservice 5}
${tcp_portmon 1 32767 rhost 6} ${alignr} ${tcp_portmon 1 32767 lservice 6}
${color #0077ff}Outbound - ${color}${tcp_portmon 32768 61000 count} ${alignr} ${color #0077ff}Remote Service/Port${color}
${tcp_portmon 32768 61000 rhost 0} ${alignr} ${tcp_portmon 32768 61000 rservice 0}
${tcp_portmon 32768 61000 rhost 1} ${alignr} ${tcp_portmon 32768 61000 rservice 1}
${tcp_portmon 32768 61000 rhost 2} ${alignr} ${tcp_portmon 32768 61000 rservice 2}
${tcp_portmon 32768 61000 rhost 3} ${alignr} ${tcp_portmon 32768 61000 rservice 3}
${tcp_portmon 32768 61000 rhost 4} ${alignr} ${tcp_portmon 32768 61000 rservice 4}
${tcp_portmon 32768 61000 rhost 5} ${alignr} ${tcp_portmon 32768 61000 rservice 5}
${tcp_portmon 32768 61000 rhost 6} ${alignr} ${tcp_portmon 32768 61000 rservice 6}
Bookmarks