Someone
public shellscript v1 · immutable#!/bin/shwhile truedo 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 '+%Y-%m-%d %H:%M'` `uptime | sed 's/.*,//'` $BAT" > ~/.dwm-status sleep 30done