Check Updates List - Report and notify only when specific packages needs an update on Archlinux

I wrote a little script that will output and notify only when updates of specific packages are available. It uses checkupdates as it’s backend.

Required non standard packages for the script, install with : yay pacman-contrib libnotify

Download the script from: checkupdateslist (don’t forget to make it executable)

Edit the scripts variable packages= to list all important packages, separated by space. If you run the script, then this list is checked. But you can also run the script with arguments, a custom list that is then checked instead the variable in the script. A star * can be used as wildcard too.

NEW: Now reads in an optional configuration file at ~/.config/checkupdateslist.cfg . No longer is it needed to edit the script itself:

packages = linux firefox
expire_ms = 0

Some usage examples of the script:

# Usage:
#   checkupdateslist [package]...
#
# Example:
#   $ checkupdateslist
#   $ checkupdateslist yt-dlp retroarch
#   $ checkupdateslist "*pipewire*"
3 Likes

| Archlinux | GNOME 45 |

$ ./checkupdateslist  "*pipewire*"
gst-plugin-pipewire
libpipewire
pipewire
pipewire-alsa
pipewire-audio
pipewire-jack
pipewire-pulse

$ ./checkupdateslist  "pipewire"

Works well!
Thanks for sharing!

1 Like

Thanks for testing and reporting, and glad its fine. :slight_smile: Idea is to check for these packages more frequently without annoying me with notifications for every single bit of update. Now the question is, what to include in the “important” list.

1 Like

You’ll probably get a different answer from each and every user.
For now, I have added *pipewire* *systemd* linux-lts linux-zen grubto the list.

Ah yes, linux is a good idea. :smiley: About the *pipewire*, I wonder if this just pollutes the output. I gave it as an example for testing, but wonder how useful this is. If anything from pipewire is updated, then the main package pipewire will be for sure too, right? So without wildcards instead getting 7 output, only 1 is enough. Just something to think about.

And for anyone wondering what packages are installed, check it out with yay -Q .

echo "📦 $(checkupdateslist | wc -l | sed 's/^0$//')"

This little line will output an (package) emoji, followed by the number of the packages. If the number is 0, then there won’t be a number displayed. I use this to display available updates on a KDE widget, which runs every now and then. As a former tiling window manager user, I am used to stuff like that.

BTW for anyone interested, I installed a custom widget from https://github.com/Zren/plasma-applet-commandoutput . I use this for several other commands too. The configuration for this is

This is nice work. Think i would have the script read from an external file that the user can easily modify without having to be in the script. Also you may want to add updates for aur packages. I can see where many would enjoy a notification for that.

personally have my own way of doing things but would definitely find this useful.

I usually tend to avoid configuration files for Bash scripts and rewrite it in Python (or anything else) when it’s required. Because I never know whats the best and safest way of doing it in Bash, while avoiding implementing a complex parser.

A configuration file for a bash script is probably easiest to write in bash language.
Then you essentially don’t need a separate parser. Might use some bash language checkers though, e.g. shellcheck.

1 Like

I updated the script to look and read from a configuration file. It’s not a Bash script, because that is a bit too wonky in my experience. The parser was much more simple than I thought, so it is a simple and straight forward configuration file with just a key=value pair.