------------------------------------------------------------------------------ Shell GUI Popup programs Xdialog Simple on based on the TTY "dialog" GUI xmessage Display text and multi-choice buttons zentity Common for linux but seems to be 'static'. yad Fork of zentity (yet another dialog) gtkdialog Generate a full GUI interface to a script. sub-shell 'actions' are generated (a bit like openbox WM) can store things in variables for later actions http://code.google.com/p/gtkdialog/ http://pclosmag.com/html/Issues/200910/page21.html notify-send temporary message popup.. (requires d-bus) xmessage Display information and a number of buttons xprompt String input entry program xmenu popup a menu of choices notifier pops up a window whenever input is received (error reporting) and many other window control utility programs Also see "WindowID.hints" for finding and using a windows ID Note znity and yad are GTK. to get stock icon names run "gtk-demo" and double clicking "Stock Item and Icon Browser" ------------------------------------------------------------------------------ Error Message Popup window remains until user presses button. See my x-windows script "error-message" Xdialog --title 'Failure' --msgbox "$@" 0x0 & xmessage -name $PROGNAME -title 'Failure' -center \ -buttons 'OK:0' -default 'OK' \ -xrm '*message.borderWidth: 0' \ -xrm '*message.scrollVertical: Never' \ "$@" & zenity --title 'Failure' --error --text="$@" & ------------------------------------------------------------------------------ Notify Message Popup popup a temporary window with a message no grabs or other interferance to user, just a informational message. See my x-windows script "notify-message" ------------------------------------------------------------------------------ Zenity notification, with changing icon! ( i=9; while [ $i -gt 0 ]; do echo icon:im/images/font_$i.gif sleep 1 i=`expr $i - 1` done ) | zenity --notification --listen ------------------------------------------------------------------------------ Zenity and Percentage Bars. Warning: with no input zenity -progress will go CPU bound! This is not good. ( i=5; while [ $i -gt 0 ]; do echo $i sleep 1 i=`expr $i + 5` done ) | zenity --progress ------------------------------------------------------------------------------ using colors and columns in a list dialog... LOGFILE=${1:-/var/log/messages} PARSER='{font=""; color="#FFFFFF"}; \ /kernel/ {font="italic"}; \ /warn/ {color="#FFF4B8"}; \ /error/ {color="#FFD0D8"}; \ OFS="\n" {print $1 " " $2, $3, $4, substr($5,0,index($5,":")-1), \ substr($0,index($0,$6)), font, color; fflush()}' tail -f $LOGFILE | awk "$PARSER" | \ yad --title="Log viewer" --window-icon=logviewer \ --button=gtk-close --geometry 600x350 \ --list --text="Content of $LOGFILE" \ --column Date --column Time --column Host \ --column Tag --column Message:TIP \ --column @font@ --column @back@ exit $? Note the awk script colors the whole line! ------------------------------------------------------------------------------- gtkdialog This creates a large 'dialog XML text' that whill generate a dialog then make bash script sub-shell calls. Various dialog elements can be stored into variables for use in those calls Calls could be pre-defined 'export -f' bash functions. Note sub-shell actions may pop up other windows using other dialog programs. Actually it seems to be a special scripting language that calls bash sub-shells to perform actions. (like many openbox) Main Page http://code.google.com/p/gtkdialog/ Good Example (at bottom) http://pclosmag.com/html/Issues/200910/page21.html Tips http://www.murga-linux.com/puppy/viewtopic.php?t=38608 ------------------------------------------------------------------------------ Add a Icon image inside a window permenately Using xwininfo get the windowid, and its size and position (to root window) NOTE: make shure you pick the appropriate child of the window. xloadimage -windowid 0xWINDOWID -at X,Y IMAGE xrefresh -geometry WIDTHxHEIGHT+X+Y This sets the background pixmap of the window to the a blank white image the size of the window with a copy of the IMAGE at the prosition given. The xrefresh will then get the client to redraw the other parts of the window. This image will be refreshed automatically by the X server whenever required. Do not use this technique for a large window to save server memory. Example add to the current xterms window: image=${1:-/usr/include/bitmaps/std/finger.xbm} child=`xwininfo -children -id $WINDOWID | sed -n 's/^ *\(0x[^ ]*\).*/\1/p'` xloadimage -windowid $child -at 420,10 $image ------------------------------------------------------------------------------ To kill a specific client Kill a client that is runing on the display without asking the user to do so. Example: Look for a xv client. NOTE: This could easily get it wrong. xkill -id `xwininfo -all -children -root | awk '/\"xv\"/ {print $1; exit}'` a winkill 'xkill -id `xwininfo -all -children -root |\\\ awk '\''/\"\!:*\"/ {print $1; exit}'\''`' Better to use the windows title for xwininfo. This must however be exact so a version or patch upgrade could invalidate it. ------------------------------------------------------------------------------ Colormap hints xv -clear To remove unused color table entries. This does not include the colors used by the root pixmap. xv -root -quit Clear unused colors including the root pixmap colors. ------------------------------------------------------------------------------