LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   popup balloon in a script? (https://www.linuxquestions.org/questions/programming-9/popup-balloon-in-a-script-4175412929/)

Cultist 06-22-2012 07:36 PM

popup balloon in a script?
 
I'm wondering if there is any way to create a pop-up balloon in KDE/XFCE/whatever in a script, like the kind that typically appears in the bottom right corner in KDE or the top right corner in XFCE.

Basically I want to automatically run this little script every hour or something:
Code:

UPDATE=$(slackpkg check-updates)
if [ "$UPDATE" = "No News Is Good News" ]; then
        exit
fi
slackpkg update

except after the last command, I would like a balloon to alert me that there are fresh updates to install.

Anyone know a way to do this?

TobiSGD 06-22-2012 08:11 PM

You can use notify-send for this:
Code:

notify-send "There are updates available."

jmccue 06-24-2012 03:12 PM

Interesting, did not know about notify-send, I was going to suggest xmessage(1).

A real cheap method, assuming your script is executed via cron, is to add this:
Code:

echo "There are updates available"
to your script. cron will then mail a message to your mailbox (file $MAIL).

I know xmessage(1) will fail if executed inside cron, not sure about notify-send.

John

fogpipe 06-24-2012 03:42 PM

zenity is also an option. Doesnt come by default with slackware. Looks nicer than xmessage tho.

fogpipe 06-24-2012 04:08 PM

Quote:

Originally Posted by TobiSGD (Post 4709748)
You can use notify-send for this:
Code:

notify-send "There are updates available."

That doesnt seem to work in fluxbox. I dont get any error message. Nothing at all happens even when i specify a critical urgency level. Any tips?

TobiSGD 06-24-2012 04:13 PM

You have to have a notifier daemon running on your system. I use xfce4-notifyd on my systems (running i3wm). Works pretty well.

fogpipe 06-24-2012 05:00 PM

Quote:

Originally Posted by TobiSGD (Post 4710816)
You have to have a notifier daemon running on your system. I use xfce4-notifyd on my systems (running i3wm). Works pretty well.

Yes it does, thank you. :)

Cultist 06-24-2012 08:35 PM

Quote:

Originally Posted by TobiSGD (Post 4709748)
You can use notify-send for this:
Code:

notify-send "There are updates available."

Exactly what I needed. Thanks.


All times are GMT -5. The time now is 01:31 AM.