redline6561
April 4th, 2007, 12:38 AM
I'm interested in getting Conky to run a bash script hourly with execi that would grep a list of available packages to update from a dist-upgrade and output them in conky. I got the idea after seeing an Arch Linux user use conky to track the latest uploads to Arch repos. The difference was Arch repos have RSS feeds on package updates so he used the conky RSS plugin. I've been able to find no such Ubuntu repo feeds and so have fallen on this as a method. I figure I can either get a bash script to simulate a dist-upgrade and grep the updates. I've modified visudo to allow it to run like so:
# User privilege specification
root ALL=(ALL) ALL
redline ALL=NOPASSWD: /home/redline/scripts/conky_updates.sh
This is the script I'm using:
#!/bin/bash
#
# Runs “apt-get update” and prints the output of a simulated
# dist-upgrade if new packages are found.
if [[ `apt-get update 2>&1 | grep Get` ]]; then
if [[ `apt-get –simulate dist-upgrade 2>&1 | grep Inst` ]]; then
apt-get –simulate dist-upgrade
fi
fi
(Sourced from:
http://www.mattiaswikstrom.net/linux/20050526-apt-update-script.html)
Conky however fails to post the results to the desktop and I know there are waiting updates because I see the update manager notification in my panel.
Finally, Here's the conky.rc excerpt:
UPDATES ${hr 2}$color
${execi 1800 /home/redline/scripts/conky_updates.sh}
If anyone wants the full conky.rc or other information it's available on request. Anyone have any advice? What am I doing wrong?
# User privilege specification
root ALL=(ALL) ALL
redline ALL=NOPASSWD: /home/redline/scripts/conky_updates.sh
This is the script I'm using:
#!/bin/bash
#
# Runs “apt-get update” and prints the output of a simulated
# dist-upgrade if new packages are found.
if [[ `apt-get update 2>&1 | grep Get` ]]; then
if [[ `apt-get –simulate dist-upgrade 2>&1 | grep Inst` ]]; then
apt-get –simulate dist-upgrade
fi
fi
(Sourced from:
http://www.mattiaswikstrom.net/linux/20050526-apt-update-script.html)
Conky however fails to post the results to the desktop and I know there are waiting updates because I see the update manager notification in my panel.
Finally, Here's the conky.rc excerpt:
UPDATES ${hr 2}$color
${execi 1800 /home/redline/scripts/conky_updates.sh}
If anyone wants the full conky.rc or other information it's available on request. Anyone have any advice? What am I doing wrong?