commit 8f18e53f748fb6a2d3b607d86a6e7640ceb8adb4 parent 668f3a1a877af5e2e915ad0c03b27a69ac6030ea Author: awy <awy@awy.one> Date: Wed, 31 Dec 2025 18:26:18 +0300 tasks spooler Diffstat:
| M | .config/i3blocks/config | | | 5 | +++++ |
| A | .local/bin/statusbar/sb-tasks | | | 20 | ++++++++++++++++++++ |
| M | aurdeps.txt | | | 1 | + |
3 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/.config/i3blocks/config b/.config/i3blocks/config @@ -4,6 +4,11 @@ interval=once signal=9 label= +[tasks] +command=sb-tasks +interval=10 +signal=26 + # [music] # command=stmusic # interval=once diff --git a/.local/bin/statusbar/sb-tasks b/.local/bin/statusbar/sb-tasks @@ -0,0 +1,20 @@ +#!/bin/sh + +# Originally by Andr3as07 <https://github.com/Andr3as07> +# Some changes by Luke +# Rebuild by Tenyun + +# This block displays the number running background tasks. Requires tsp. + +num=$(tsp -l | awk -v numr=0 -v numq=0 '{if (/running/)numr++; if (/queued/)numq++} END{print numr+numq"("numq")"}') + +# Handle mouse clicks +case $BLOCK_BUTTON in +1) setsid -f "$TERMINAL" -e tsp -l >/dev/null 2>&1 ;; +3) notify-send "Tasks module" "🤖: number of running/queued background tasks +- Left click opens tsp" ;; # Right click +8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;; +esac + +[ "$num" != "0(0)" ] && + echo "🤖$num" diff --git a/aurdeps.txt b/aurdeps.txt @@ -9,3 +9,4 @@ newsraft dragon-drop-git qarma-git abook +task-spooler