waybar changes 1
This commit is contained in:
7
modules/home/programs/waybar/bin/waybar-progress
Normal file
7
modules/home/programs/waybar/bin/waybar-progress
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
output="$(progress -q)"
|
||||
text="$(printf "%s" "$output" | sed 's/\[[^]]*\] //g' | awk 'BEGIN { ORS=" " } NR%3==1 { op=$1 } NR%3==2 { pct=($1+0); if (op != "gpg" && op != "coreutils" && pct > 0 && pct < 100) { print op, $1 } }')"
|
||||
tooltip="$(printf "%s" "$output" | perl -pe 's/\n/\\n/g' | perl -pe 's/(?:\\n)+$//')"
|
||||
|
||||
printf '{"text": "%s", "tooltip": "%s"}\n' "$text" "$tooltip"
|
||||
Reference in New Issue
Block a user