I wanted to get notified about when new packages were available for my Archlinux system. As many of you know, I'm using the awesome window manager. With it comes naughty, the code responsible of displaying notifications. So, how to get new packages notification in awesome? Easy, just talk to your naughty and tell him about new packages. Here is what I've done:

In my ~/.config/awesome/rc.lua I say I want naughty to be enabled:

require("naughty")

And then I created a very simple script with the call to naughty in it:

#!/bin/bash
 
packages=`pacman -Qu`
 
if [ ! -z "$packages" ]
then
    echo "naughty.notify({title = \"Packages updates found!\", text = \"$packages\", timeout = 10, icon = \"/usr/share/icons/gnome/48x48/status/messagebox_warning.png\", fg = \"#ffffff\", bg = \"#000000\"})" | awesome-client -
fi

Finally I added it to my crontab to run each hour.

Easy, wasn't it :)

Tagged as pacman, archlinux, awesome, notifier

If you liked this post, you can donate using Bitcoin 12jVrWkk5S6x5hEizThZwgTx59KxaDdK4C