status.sh (577B)
1 #!/usr/bin/env sh 2 3 clean_task () { 4 echo "$1" | sed -E 's/^[0-9]+-[0-9]+-[0-9]+ //' | 5 sed -E 's/\+active//' | 6 sed -E 's/ \@[[:alpha:]]+//' 7 } 8 9 while true; do 10 LAYOUT=$(setxkbmap -query | grep layout | awk '{print $2}') 11 CHARGE=$(apm -l) 12 DATE=$(date '+ %H:%M %d-%m-%Y') 13 14 #SONG=$(mpc current) 15 [ -n "$SONG" ] && SONG="🎧 $SONG " 16 17 TASK=$(grep "+active" /home/anton/public_gopher/todo.txt | grep -v "^x") 18 [ -n "$TASK" ] && TASK="🔵 $(clean_task "$TASK")" 19 20 xsetroot -name "$TASK $SONG🔋$CHARGE% $LAYOUT $DATE" 21 sleep 0.2 22 done