Following is the bash script I’m using with polybar to display number of system updates available, I tried incorporating aur updates with paru -Qau (it shows updates available just like checkupdates command).
But failed due to lack of knowledge about bash scripting, if anyone can help?
Regards
#!/usr/bin/env bash
updates=$(checkupdates)
if [ -z "$updates" ]
then
count=0
else
printf '%s\n' "$updates" > /tmp/bspwm-eos-polybar-updates
count=$(wc -l "/tmp/bspwm-eos-polybar-updates" | awk '{print $1}')
fi
echo "%{T1}%{T-} %{T2}$count%{T-}"
I’m not sure why you’re replying to me with this, but the solution I proposed can literally be put into a polybar module without the need of a script. Just set a timer in the module to run it every x hour/minute/day.
Oh, I think I misunderstood your solution earlier, sorry for that, yeah I think your approach is simpler.
if you are talking about the comments, I made in response to @moson , sorry for that also, I don’t know, how everything just getting messy for some reason, I’m replying to someone else, and being mentioned someone else in the response…
Just a note here if a ‘script’ is still wanted… in a different thread, I posted a couple of useful bash functions for a) counting pending updates and b)showing a formatted list of pending updates. These could easily be turned into scripts (if needed that way) and swapping in a paru command instead of the yay command should be easy enough.