You are not logged in.

#1 2007-01-21 11:18:14

kyku
Member
Registered: 2006-02-07
Posts: 24

Pacman update count applet/app.

Hello All

I've downloaded some conky configurations from this site, that display the number of available packages to be upgraded. It is bundled with a perl script that scans a file called 'updates.log' and simply displays number of lines matching some regexp. However I'd like to know the app that fills the updates.log file.

Offline

#2 2007-01-21 14:02:18

Xilon
Member
Registered: 2007-01-01
Posts: 243

Re: Pacman update count applet/app.

Well I made a bash script to do this for myself. It prints out all the available packages to be upgraded and the total amount

#!/bin/bash
# Arch upgradeable packages

list=`pacman -Sup 2> /dev/null`

if [ "$list" == "" ]; then
    count=0
else
    count=`echo "$list" | wc -l`
fi

for pkg in $list; do
    echo -n "  "
    echo $pkg | sed -e 's#.*/##g' -e 's%(.*).pkg.*$%1%'
done

echo "  Total: $count"

Just add a line like ${execi 1800 ~/pacman.sh}
Pacman's database will need to be updated beforehand though

Offline

#3 2007-01-22 01:17:03

vredfreak
Member
Registered: 2004-11-20
Posts: 66

Re: Pacman update count applet/app.

kyku wrote:

Hello All

I've downloaded some conky configurations from this site, that display the number of available packages to be upgraded. It is bundled with a perl script that scans a file called 'updates.log' and simply displays number of lines matching some regexp. However I'd like to know the app that fills the updates.log file.

I believe you are speaking about my tiny little perl script that parses "updates.log" and outputs to conky.

The command that outputs to updates.log is pacman itself.  If you look in the file pacsync.sh you will see the command.

pacman -Syup --noprogressbar > /PATH/TO/updates.log

Type 'pacman -Syup --noprogressbar' into a terminal and you get the same thing.  It just doesn't get sent to a logfile.

Basically you can spit the output from any command to a file of your choice with ">" or ">>".  The first one will overwrite the contents of the file, the second will just append the info to the end of the file.

Hope this helps.


Hi.  I'm a sig.  What are you?

Offline

#4 2007-01-22 18:08:40

kyku
Member
Registered: 2006-02-07
Posts: 24

Re: Pacman update count applet/app.

Hello, thanks you both. Now I have my conky almost fully configured (still lacking temps though).

Offline

Board footer

Powered by FluxBB