Conkydevices.sh (en)

From Conky PitStop

Jump to: navigation, search

conkydevices.sh

 Language   English   Français   


Script-crinos512-conkydevices.png

A script to show the usage and status of my attached HDDs. This script relies on Using hddtemp and my colorize.sh script.

NOTE: This script will likely need serious modification to work on your system (different drives and partitions, etc.), but it shouldn’t be that difficult.

#!/bin/sh
# conkydevices.sh
# by Crinos512
# Usage:
#  ${execp ~/.conky/conkyparts/conkydevices.sh}
#
SDAType=`hddtemp /dev/sda | cut -c11-28`
SDBType=`hddtemp /dev/sdb | cut -c11-22`
SDCType=`hddtemp /dev/sdc | cut -c11-30`
SDATemp=`hddtemp /dev/sda | paste -s |sed 's/°/\n/'| head -n1 | cut -c31- | xargs ~/.conky/conkyparts/colorize.sh`".0°C"
SDBTemp=`hddtemp /dev/sdb | paste -s |sed 's/°/\n/'| head -n1 | cut -c25- | xargs ~/.conky/conkyparts/colorize.sh`".0°C"

echo "\${color1}\${stippled_hr 1}\${color}"
echo "\${voffset -6}  File Systems:\${font Liberation Mono:size=8}"
echo "\${voffset -6}\${color1}\${stippled_hr 1}\${color}"
echo "  \`sda ( $SDAType )\${goto 340}$SDATemp\${color}"
echo "\${goto 25}\${color3}\${fs_bar 10,350 /}\${color}"
echo "\${voffset -12}     / \${goto 150}\${fs_free /} (\${fs_free_perc /}%) free of \${fs_size /}"
echo "  \`sdb ( $SDBType )\${goto 340}$SDBTemp\${color}"
echo "\${goto 25}\${color3}\${fs_bar 10,350 /home}\${color}"
echo "\${voffset -12}     /home \${goto 150}\${fs_free /home} (\${fs_free_perc /home}%) free of \${fs_size /home}"
echo "  \`sdc \${if_mounted /media/PTAH}( $SDCType )"
echo "\${goto 25}\${color3}\${fs_bar 10,350 /media/PTAH}\${color}"
echo "\${voffset -12}     /media/PTAH \${goto 150}\${fs_free /media/PTAH} (\${fs_free_perc /media/PTAH}%) free of \${fs_size /media/PTAH}\${font}\${else}( -- )"
echo "\${goto 25}\${color 000000}\${fs_bar 10,350 /media/PTAH}\${color}"
echo "\${voffset -12}     /media/PTAH \${goto 150}- NOT MOUNTED -\${font}\${endif}"

exit 0

[UPDATED: 14 Sept. 2009]

Personal tools
Namespaces
Variants
Actions
Navigation
English
Français
Toolbox