johnlee
Posts: 12
Joined: Sun Apr 06, 2014 12:07 pm

popup window/messagebox for rpi

Sun Mar 15, 2015 1:32 pm

Been googling gui, popup, window - seems very complicated - all I want is the ability, from bash, or perl, under wheezy, to put up an information window on desktop - just some text that lasts for n seconds and tells me when some script or program running in the background or started using @reboot, has started, or when an error has occurred. In windows it is called a message box.

Must be something out there - Can someone pls point me at something.

TIA John

User avatar
rpdom
Posts: 17170
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: popup window/messagebox for rpi

Sun Mar 15, 2015 1:39 pm

Look at the "zenity" package. It can put various message boxes on the screen from bash.
Description: Display graphical dialog boxes from shell scripts
Zenity allows you to display GTK+ dialogs from shell scripts; it is a
rewrite of the `gdialog' command from GNOME 1.
.
Zenity includes a gdialog wrapper script so that it can be used with
legacy scripts.
I haven't tried it on a Pi, but I believe it should work.

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: popup window/messagebox for rpi

Sun Mar 15, 2015 4:10 pm

whiptail is installed in raspbian by default and is used to create the menu system for raspi-config.

johnlee
Posts: 12
Joined: Sun Apr 06, 2014 12:07 pm

Re: popup window/messagebox for rpi

Sun Mar 15, 2015 5:12 pm

Thanks - zenity already installed in wheezy on rpi. It seems able to do lots of things - my message box is just one of n. Google didn't show it

zenity --info --text="ok" --timeout=5 2> /dev/null outputs an ok message box for 5 secs. I had to include the 2?/dev/null to stop a zenity warning saying ' can't access accessibility bus address' or something like that I didn't understand, but otherwise it is just what I needed.

John

Return to “Advanced users”