Files
dotfiles/fastfetch/scripts/updates.sh
Nikolai Papin 761b4e2bac refactor: moved useful scripts from the bspwm folder to more appropriate locations;
fix: checkupdates script for fastfetch causing delays;
chore: removed bspwm and picom since I haven't been using or maintaining them
2025-11-17 17:50:56 +03:00

25 lines
610 B
Bash
Executable File

#!/bin/bash
# Always read from cache and return immediately
count=$(cat /tmp/checkupdates 2>/dev/null)
# nohup checkupdates > /tmp/checkupdates & disown
# $(checkupdates | wc -l > /tmp/checkupdates) & disown
if [[ $? -ne 0 ]] || [[ -z "$count" ]]; then
status="Unknown"
else
if [[ $count == "Unknown" ]]; then
status="Unknown"
elif [[ $count -eq 0 ]]; then
status="Up to date"
elif [[ $count -eq 1 ]]; then
status="$count update"
else
status="$count updates"
fi
fi
echo "$status"
exec "$HOME/.config/fastfetch/scripts/fetch_update_count.sh" & disown