diff --git a/config.sh b/config.sh index 54f657b..6536696 100755 --- a/config.sh +++ b/config.sh @@ -7,6 +7,10 @@ # network device, needed for upload and download modules export netdevice="" +# mail directory, needed for mail module +export maildir="" + +# module list. uncomment to enable. # module list. uncomment to enable. # re-arrange to change order. # module name icon/prefix suffix @@ -25,4 +29,5 @@ export netdevice="" #module_todo "TODO: " " | " #module_upload "Up: " " | " #module_download "Down: " " | " +#module_mail "Mail: " " | " module_date "Date: " "" diff --git a/modules.sh b/modules.sh index 262ceae..f59eddb 100755 --- a/modules.sh +++ b/modules.sh @@ -71,3 +71,8 @@ module_download() { down="$(cat /sys/class/net/${netdevice}/statistics/tx_bytes | awk '{$1=$1/1024000; print $1"B";}' | tail -n 1)" export bar="${bar}${1}${down}${2}" } + +module_mail() { + mailoutput="$(ls ${maildir} | wc -l)" + [ "$mailoutput" = "0" ] || export bar="${bar}${1}${mailoutput}${2}" +}