Notifications of pacman updates
Archlinux provides an handy script called checkupdates
, to check for available pacman updates without requiring the root password. This post will explain how to use this tool to automatically get a nice notification whenever new updates are ready to be installed.
The notifier script
Create a simple script that runs checkupdates
and sends a notification if necessary:
Put this script in a location in your $PATH
and make sure is executable. In this example I will use ~/bin/updates-notifier.sh
.
Periodically run the script
We are going to use systemd timer to periodically execute the script. Systemd timers are easy to create (I hate the syntax of cron!) and don’t require root privileges.
Create the service file
Create the file ~/.config/systemd/user/updates-notifier.service
with the following content:
This will take care to execute the notifier script.
Create the timer file
Create the file ~/.config/systemd/user/updates-notifier.timer
with the following content:
This timer will simply trigger the updates-notifier.service
every hour.
Enable the timer
Just run:
This is the resulting notification in a Plasma desktop!