1
0
Fork 0
dotfiles/common/.local/libexec/statusbar/sb-task

29 lines
472 B
Bash
Executable File

#!/bin/sh
. libsb
icon=󰄵
task sync
# get_context() {
# task context show | awk "NR==1 { gsub(\"'\", \"\"); print \$2 }"
# }
get_active() {
num_active=$(task export active | jq length)
[ "$num_active" = 0 ] && {
echo "No active task"
return
}
[ "$num_active" -gt 1 ] && {
echo "$num_active active tasks"
return
}
task export active | jq -r '.[0].description'
}
printf "%s %s\n" "$icon" "$(get_active)"