dotfiles

Settings and scripts
git clone git://git.konyahin.xyz/dotfiles
Log | Files | Refs | LICENSE

commit ff4f954be5a127b91262f0d8a8b2593aad49d67f
parent 23ecf714c04520b8d4f2e51d8a4d0dce5165e3e6
Author: Anton Konyahin <me@konyahin.xyz>
Date:   Sat, 10 Feb 2024 20:54:12 +0300

scripts: add active task in status bar

Diffstat:
Mscripts/dot-bin/status.sh | 17++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/scripts/dot-bin/status.sh b/scripts/dot-bin/status.sh @@ -1,15 +1,22 @@ #!/usr/bin/env sh +clean_task () { + echo "$1" | sed -E 's/^[0-9]+-[0-9]+-[0-9]+ //' | + sed -E 's/\+active//' | + sed -E 's/ \@[[:alpha:]]+//' +} + while true; do LAYOUT=$(setxkbmap -query | grep layout | awk '{print $2}') CHARGE=$(apm -l) DATE=$(date '+ %H:%M %d-%m-%Y') - SONG=$(mpc current) - if [ -n "$SONG" ]; then - SONG="🎧 $SONG " - fi + #SONG=$(mpc current) + [ -n "$SONG" ] && SONG="🎧 $SONG " + + TASK=$(grep "+active" /home/anton/data/notes/todo.txt) + [ -n "$TASK" ] && TASK="🔵 $(clean_task "$TASK")" - xsetroot -name "$SONG🔋$CHARGE% $LAYOUT $DATE" + xsetroot -name "$TASK $SONG🔋$CHARGE% $LAYOUT $DATE" sleep 0.2 done