[[HomePage]] > [[SoftwareIndex Software Index]] > [[SoftwareDevelopment Development]] > [[Xdialog]] ======Xdialog examples====== [[http://web.mit.edu/outland/share/doc/Xdialog-2.1.2/index.html Xdialog is well documented ]], but examples are hard to find (except within Puppy scripts). Here are a few, which can be copied & pasted into a terminal to try out. Please add useful examples if you have them. ====How to obtain output from Xdialog==== 1) exit status $? yes or ok -> 0, no, cancel, ESC -> 1, timeout or window closed -> 255 with --wizard option, next button -> 0, previous button -> 3 2) assign stderr to variable for choices in inputbox, radiolist, etc., {{color text='b=$(Xdialog .... 2>&1)' c='green'}} or {{color text='b=$(Xdialog --stdout .... )' c='green'}} ====Examples==== The series of 2 or 3 numbers after "text" is for sizing. Zeros-> autosize, which may not work well. ==yesno== **{{color text='Xdialog --timeout 2 --yesno "Choose" 0 0 ; a=$?' c='green'}}** sets $a=0, 1 or 255 **{{color text='Xdialog --ok-label Maybe --cancel-label "Maybe not" --yesno "Choose" 0 0 ; a=$?' c='green'}}** ==gauge== **{{color text='for i in {0..100..10} ; do echo $i ; sleep 1 ; done | Xdialog --gauge "Ten second countdown" 0 0' c='green'}}** Progress of a more complex task involving a list of L files. (thanks to gnashley [[https://www.linuxquestions.org/questions/programming-9/need-help-with-dialog-xdialog-gauge-option-271705/ here]]) **{{color text='count=0 ; L=$(wc -l