Ubuntu Forums Archive Viewer

HOWTO: Display Available Updates in Conky

Archived thread 1012974 from Outdated Tutorials & Tips. Markdown source: Outdated_Tutorials_&_Tips/thread_1012974_HOWTO_Display_Available_Updates_in_Conky.md

Original URL About this archive
#1

I've written this script for Debian but Ubuntu should work just the same provided the user in question is able to gain root access via sudo without a password. Simply save the code as debupdates.sh in your ~/bin and mark it executable. Here is the code:

#!/bin/bash

Conky script for displaying available updates

in Debian. This script assumes you are in the

sudo group and require no password for root

access. Add something as such to your conkyrc:

#${color}APT: ${color D7D3C5}${execi 28800 ~/bin/debupdates.sh}

sudo apt-get -qy update > /dev/null NUMOFUPDATES=$(sudo aptitude search "~U" | wc -l) echo $NUMOFUPDATES Updates Available

Next, simply add something like such to your conkyrc:

$color}APT: ${color D7D3C5}${execi 28800 ~/bin/debupdates.sh}

Here is a screenshot of the output:

#2

dude i have been looking everywhere for something like this nice share cheers!!

#3

yeah, thanks, man!!!