All pastes #639601 Raw Edit

Something

public text v1 · immutable
#639601 ·published 2007-07-30 18:11 UTC
rendered paste body
#!/bin/sh

while true
do
  DATE=$(date +"%Y-%m-%d %H:%M")
  LOAD=$(uptime | sed 's/.*,//')

  full=$(grep "full capacity" /proc/acpi/battery/C1B5/info | tr -s ' ' |cut -d' ' -f4)
  current=$(grep "remaining capacity" /proc/acpi/battery/C1B5/state | tr -s ' ' |cut -d' ' -f3)
  BAT=$(echo "$current*100/$full" | bc)

  cd ~/mail
  for i in *; do 
    if [ -d $i/new ]; then 
      n=`ls $i/new/ | wc -l`
      if [[ $n > 0 ]]; then
        MAILS="$MAILS$i=$n, "
      fi
    fi
  done

  echo "$MAILS $DATE $LOAD $BAT%" > ~/.dwm-status
  sleep 30
done