You are not logged in.

1

Wednesday, May 24th 2006, 6:47pm

Pop-up Windows

How do i get a pop-up window to show up on the desktop to help warn people of a possible sytem problem. Instead, the warning window shows up on the panal area (bottom) of KDE. If you don't pay close attention you can miss the message. Does anyone know how to make them show up the Desk Top instead?

2

Tuesday, September 12th 2006, 12:40am

Check out this article on how to use knotify in your scripts:
http://lukeplant.me.uk/articles.php?id=3

Zenity also works, for KDE and gnome..

$ zenity --question --title "Alert" --text "Microsoft Windows has been found! Would you like to remove it?"

The problem is, KDE swallows this popup when you run it from a shell script. A C program wrapper is ok. Here's a very bad example. Compile with gcc popup.c -o popup

Source code

1
2
3
4
5
6
7
8
9
10
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv)
{
    if (system("zenity --question --title 'Alert' --text 'Microsoft Windows has been found! Would you like to remove it?'"))
   {
       printf("Popup window shown. \n");
       exit(EXIT_SUCCESS);
    } else exit(EXIT_FAILURE);
}


What is this zenity anyway, you ask?

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$ which zenity
/usr/bin/zenity
$ rpm -qf /usr/bin/zenity
gnome-utils-2.14.0-5.fc5
$ rpm -qi gnome-utils-2.14.0-5.fc5
Name        : gnome-utils                  Relocations: (not relocatable)
Version     : 2.14.0                            Vendor: Red Hat, Inc.
Release     : 5.fc5                         Build Date: Wed 02 Aug 2006 08:58:19 AM AKDT
Install Date: Tue 15 Aug 2006 11:12:24 AM AKDT      Build Host: hs20-bc1-6.build.redhat.com
Group       : Applications/System           Source RPM: gnome-utils-2.14.0-5.fc5.src.rpm
Size        : 17382160                         License: GPL
Signature   : DSA/SHA1, Mon 14 Aug 2006 11:49:37 AM AKDT, Key ID b44269d04f2a6fd2
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL         : http://www.gnome.org
Summary     : GNOME utility programs.
Description :
GNOME (GNU Network Object Model Environment) is a user-friendly set of
GUI applications and desktop tools to be used in conjunction with a
window manager for the X Window System. The gnome-utils package
includes a set of small "desk accessory" utility applications for GNOME

This post has been edited 12 times, last edit by "fozner" (Sep 20th 2006, 7:49am)