LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-30-2013, 08:25 AM   #1
Andy Alkaline
Member
 
Registered: Jun 2004
Location: Minnesota, USA
Distribution: Slackware32-stable, Debian-wheezy-amd64, LFS 7.1
Posts: 351

Rep: Reputation: 33
update notifier for xfce - desktop independent


I've made two bash scripts, one to check and one to notify. They work, but any improvement suggestions are welcome. I'm also posting them here for people who have something like this on their wish list. I think the biggest problem is that I don't know how to determine a dynamic display number, so 0.0 is always used, but I think for the average user that shouldn't be a problem.

Code:
#!/bin/bash
# anyDE-update-check.sh 0.5.1
# April 30, 2013
# 
# run as root from a cron job
# ex: 0 */6 * * * /usr/bin/anyDE-update-check.sh
USER=andy
SCRIPTPATH=/home/$USER/bin

pgrep anyDE-update-no > /dev/null

if [ $? -eq 0 ]; then
	exit 0
fi

apt-get dist-upgrade --assume-no > /dev/null

if [ $? -eq 1 ]; then
	DISPLAY=:0.0 su $USER -c $SCRIPTPATH/anyDE-update-notifier.sh &
fi

exit $?
Code:
#!/bin/bash
# anyDE-update-notifier.sh 0.1.0
# April 30, 2013
#
# Use with anyDE-update-check.sh
#
# see man xterm for options, to be used with anyDE-update-check.sh

OPTIONS="-iconic -hold -geometry 50x5"

xterm $OPTIONS -T "Updates Available"  -e 'echo Updates are available'
 
Old 04-30-2013, 11:51 AM   #2
Andy Alkaline
Member
 
Registered: Jun 2004
Location: Minnesota, USA
Distribution: Slackware32-stable, Debian-wheezy-amd64, LFS 7.1
Posts: 351

Original Poster
Rep: Reputation: 33
For those preferring an alternate implementation, someone suggested the update-notifier package to me in the Debian forum:

http://www.linuxquestions.org/questi...ce-4175460151/
 
  


Reply

Tags
apt-get update, apt-get upgrades, xfce


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail notifier for Slack 14 XFCE ? gracien Slackware 14 10-24-2012 12:05 PM
Package update notifier xfce aquaboot Debian 1 09-29-2012 03:27 PM
debian update-notifier sycamorex Linux - Software 1 01-27-2008 11:45 AM
update-notifier problem kuratkull Debian 3 10-29-2006 07:51 AM
update-notifier not showing up pbb Linux - Software 1 01-25-2006 01:22 AM


All times are GMT -5. The time now is 07:34 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration