Waybar packages updates: Show only first 25 packages.

This commit is contained in:
Viyurz 2024-06-15 13:18:47 +02:00
parent c6b33dbae9
commit cc893abdc9
Signed by: Viyurz
SSH key fingerprint: SHA256:IskOHTmhHSJIvAt04N6aaxd5SZCVWW1Guf9tEcxIMj8

View file

@ -14,9 +14,13 @@ while [[ $retry_count -le $max_retries && $success -ne 1 ]]; do
case $? in
# Update(s) available
0)
max_shown=25
success=1
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"
;;