You are not logged in.

#1 2009-05-16 04:56:05

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Another very simple pacman update notifier

I was recently screwing around with my Conky config and decided to — what the hell — add an update counter. So here's the script:

#!/bin/bash
po=$(pacman -Qu)
echo $po | grep -q 'Targets'
if [ $? = 0 ]; then # grep found something
    echo $po |
    sed 's/^.*Targets ([0-9]*):\(.*\)Total Download Size:.*/\1/' |
    wc -w
else
    echo 0
fi

It takes the output of pacman -Qu and [rather hackily] parses it.

Note: You'll need to have pacman automatically update the package databases. I use a bash script in /etc/cron.hourly.

Last edited by Peasantoid (2009-05-16 05:18:11)

Offline

Board footer

Powered by FluxBB