Waybar packages updates: Show only first 25 packages.
This commit is contained in:
parent
c6b33dbae9
commit
cc893abdc9
1 changed files with 5 additions and 1 deletions
|
@ -14,9 +14,13 @@ while [[ $retry_count -le $max_retries && $success -ne 1 ]]; do
|
||||||
case $? in
|
case $? in
|
||||||
# Update(s) available
|
# Update(s) available
|
||||||
0)
|
0)
|
||||||
|
max_shown=25
|
||||||
success=1
|
success=1
|
||||||
output=$(echo "$cmd_res" | wc -l)
|
output=$(echo "$cmd_res" | wc -l)
|
||||||
tooltip="$(echo "$cmd_res" | sed -z 's/\n/\\n/g' | sed 's/\\n$//')"
|
tooltip="$(echo "$cmd_res" | head -n "$max_shown" | sed -z 's/\n/\\n/g' | sed 's/\\n$//')"
|
||||||
|
if [[ $output -gt $max_shown ]]; then
|
||||||
|
tooltip="$tooltip\n[..] +$((output - max_shown))"
|
||||||
|
fi
|
||||||
class="update-available"
|
class="update-available"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue