sb-task: shorten status block
This commit is contained in:
parent
e4d5f1914f
commit
301eb176f0
|
@ -3,24 +3,24 @@
|
|||
|
||||
icon=
|
||||
|
||||
get_context() {
|
||||
task context show | awk "NR==1 { gsub(\"'\", \"\"); print \$2 }"
|
||||
}
|
||||
# get_context() {
|
||||
# task context show | awk "NR==1 { gsub(\"'\", \"\"); print \$2 }"
|
||||
# }
|
||||
|
||||
get_active() {
|
||||
num_active=$(task export active | jq length)
|
||||
num_active=$(task export active | jq length)
|
||||
|
||||
[ "$num_active" = 0 ] && {
|
||||
echo "No active task"
|
||||
return
|
||||
}
|
||||
[ "$num_active" = 0 ] && {
|
||||
echo "No active task"
|
||||
return
|
||||
}
|
||||
|
||||
[ "$num_active" -gt 1 ] && {
|
||||
echo "$num_active active tasks"
|
||||
return
|
||||
}
|
||||
[ "$num_active" -gt 1 ] && {
|
||||
echo "$num_active active tasks"
|
||||
return
|
||||
}
|
||||
|
||||
task export active | jq -r '.[0].description'
|
||||
task export active | jq -r '.[0].description'
|
||||
}
|
||||
|
||||
printf "%s %s: %s\n" "$icon" "$(get_context)" "$(get_active)"
|
||||
printf "%s %s\n" "$icon" "$(get_active)"
|
||||
|
|
Loading…
Reference in New Issue