mine-hyprdots/bin/pacman-updates.sh
2024-09-15 12:31:53 +05:30

17 lines
293 B
Bash
Executable file

#!/bin/sh
# Script for use in waybar to display # of pacman updates
OUTPUT="$(checkupdates)"
if [ -z "$OUTPUT" ]; then
exit 0
else
NUMBER="$(echo "$OUTPUT" | wc -l)"
TEXT="󰏔"
TOOLTIP="$NUMBER updates found"
echo "{\"text\":\"""$TEXT""\", \"tooltip\":\"""$TOOLTIP""\"}"
exit 0
fi