ConkyMounts script by Wyn, my custom Conky Config (LINUX ONLY)
I use Conky on my Ubuntu system to keep me aware of what all is going on in my system. For those of you who don’t know, “Conky is a free, light-weight system monitor for X, that displays any information on your desktop. Conky is licensed under the GPL and runs on Linux and BSD.” I was irritated when I found the basic way to display file system information such as free space/total space was to hard code each volume into the conky config file. So, I spent a few hours relearning basic, then converting my brain into linux shell scripting, and wrote a script to automagically do it for me. See the section under MOUNTED DEVICES in the screenshot below.
–EDIT– I improved my script and it is no longer separate files. To display mounts, simply add this line to your conky config:
${execpi 30 grep -v -E ^fuse|^udev|^lrm|^securityfs|^binfmt|^devpts|^tmpfs|^varlock|^varrun|^sysfs|^/proc /etc/mtab | cut -d” ” -f2 | while read line ; do
echo $line ‘${goto 160}${fs_used ‘$line’} ${alignr}${fs_size ‘$line’}’
done }
To download my Conky config, click HERE.
For those of you geeky enough to be interested, the script pulls a list of mounted volumes from /etc/mtab and trims out system created volumes. It then passes this info along to a line to be parsed by conky to display the mount point, free space, and total space. (You can do a bar graph too if you want.) What’s lovely about it, is that it updates at whatever interval you have it set at. So, if you plug in your usb stick and wait just a bit, boom now your usb is in the list.
This is very useful. It’s almost perfect –> script keeps polling unused mount points after unmounting device.
aCer said this on February 23, 2009 at 12:10 pm |
Was that before my bash-fu made it a one-liner in the conkyrc? Try the new improvment.
wynneth said this on March 2, 2009 at 3:06 am |
it is Conky “statfs” feature
Try:
${if_mounted /media/disk}${fs_bar /media/disk}$endif
and it will poll “/media/disk” immediatelly even without mounting but since “if_mounted” statement it shouldn’t – 1.7.0rc2 have it too
dk75 said this on April 26, 2009 at 11:17 am |
Hi
Can you modify the script to show even the CD’s and DVD’s disk space usage
next thing is .
can you please modify the script so that the echo $line in the script shows /media/disk
/media/disk1 or some name ..
but Im not interested in /media everytime .because I know that these things will be mounted there itself ..so if I could get only the disk name then it would be even better
Sampath said this on July 8, 2009 at 7:18 am |
Hi,
Great screenshot. However, I could only make you’re conky code work for two filesystems. More than that the loop for some reason breaks.
Could you post your shell script conkymounts?
Further I realized the code can be simpler making the starting command as
df | grep /dev/sd | grep -v boot | awk ‘{print $NF}’ ## while loop starts after this …
Anyway pls post your shell script conkymounts
a.sarkar said this on August 19, 2009 at 12:33 am |