Revision history for Xdialog examples
Additions:
or {{color text='b=$(Xdialog --stdout .... )' c='green'}}
Deletions:
Additions:
**{{color text='Xdialog --ok-label Maybe --cancel-label "Maybe not" --yesno "Choose" 0 0 ; a=$?' c='green'}}**
Additions:
sets $b=typed text, or /path/file in case of drag & drop
**{{color text='b=$(Xdialog --password=2 --separator "|" --2inputsbox "Open encrypted file" 0 0 file "" password "" 2>&1)' c='green'}}**
$b=/path/myfile.bfe|p4ssw0rd
**{{color text='b=$(Xdialog --password=2 --separator "|" --2inputsbox "Open encrypted file" 0 0 file "" password "" 2>&1)' c='green'}}**
$b=/path/myfile.bfe|p4ssw0rd
Deletions:
Additions:
{{color text='b=$(Xdialog .... 2>&1)' c='green'}}
**{{color text='count=0 ; L=$(wc -l </tmp/list)'c='green'}}**
sets $b=text input (supports drag & drop)
sets $b=latest choice on timeout or OK
might return $b=1 1 1 2 2 2 2 2 for example
**{{color text='count=0 ; L=$(wc -l </tmp/list)'c='green'}}**
sets $b=text input (supports drag & drop)
sets $b=latest choice on timeout or OK
might return $b=1 1 1 2 2 2 2 2 for example
Deletions:
**{{color text='count=0'c='green'}}**
sets $b=text input
sets $b=latest choice on timeout
might return $b=1 1 1 2 2 2 2 2 2 2 for example
Additions:
**{{color text='let count++ 'c='green'}}**
**{{color text='bc<<<"100*$count/$L"'c='green'}}**
**{{color text='bc<<<"100*$count/$L"'c='green'}}**
Deletions:
Additions:
**{{color text='count=0'c='green'}}**
**{{color text='bc<<<"100*$count/$l"'c='green'}}**
sets $b=tag2 for example
**{{color text='bc<<<"100*$count/$l"'c='green'}}**
sets $b=tag2 for example
Deletions:
**{{color text='let p+=inc ; echo $p'c='green'}}**
Additions:
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='p=0 ; let inc=100/L'c='green'}}**
**{{color text='{ while read file ; do'c='green'}}**
**{{color text='[do something with $file]'c='green'}}**
**{{color text='let p+=inc ; echo $p'c='green'}}**
**{{color text='done < /tmp/list } | Xdialog --gauge "Progress" 0 0'c='green'}}**
==radiolist==
Deletions:
Additions:
[[HomePage]] > [[SoftwareIndex Software Index]] > [[SoftwareDevelopment Development]] > [[Xdialog]]
Deletions:
Additions:
[[HomePage]] > [[SoftwareIndex Software Index]] > [[SoftwareDevelopment Development]] > [[Xdialog]
Deletions:
Additions:
[[HomePage]] > [[SoftwareIndex Software Index]] > [[SoftwareDevelopment Development]]
Deletions:
Additions:
**{{color text='while true ; do sleep 1 ; echo -e "XXX\n`date`\nXXX" ; done | Xdialog --infobox "Initial text" 8 60 0' c='green'}}**
Initial text is overwritten. XXX = new text tag.
Initial text is overwritten. XXX = new text tag.
Deletions:
Initial text is immediately overwritten. XXX = new text tag.
Additions:
might return $b=1 1 1 2 2 2 2 2 2 2 for example
Deletions:
Additions:
with --wizard option, next button -> 0, previous button -> 3
Deletions:
Additions:
next button -> 0, previous button -> 3 (--wizard option)
Deletions:
Additions:
The series of 2 or 3 numbers after "text" is for sizing. Zeros-> autosize, which may not work well.
Deletions:
Additions:
yes or ok -> 0, no, cancel, ESC -> 1, timeout or window closed -> 255
next button -> 0, previous button -> 3 (--wizard option), help button -> 2 (--help option)
next button -> 0, previous button -> 3 (--wizard option), help button -> 2 (--help option)
Deletions:
Additions:
The series of 2 or 3 numbers after "text" is for sizing. Zeros-> autosize, which sometimes doesn't work well.
**{{color text='b=$(Xdialog --radiolist "Sound" 0 0 0 ' c='green'}}tag1 "PC" off tag2 "HDMI" on tag3 "BT" off{{color text=' 2>&1)' c='green'}}**
**{{color text='b=$(Xdialog --timeout 4 --interval 4000 --radiolist "asldkjf" 12 20 3 ' c='green'}}1 "first choice" off 2 "second choice" on 3 "third choice" off{{color text=' 2>&1)' c='green'}}**
**{{color text='b=$(Xdialog --radiolist "Sound" 0 0 0 ' c='green'}}tag1 "PC" off tag2 "HDMI" on tag3 "BT" off{{color text=' 2>&1)' c='green'}}**
**{{color text='b=$(Xdialog --timeout 4 --interval 4000 --radiolist "asldkjf" 12 20 3 ' c='green'}}1 "first choice" off 2 "second choice" on 3 "third choice" off{{color text=' 2>&1)' c='green'}}**
Deletions:
**{{color text='b=(Xdialog --timeout 4 --interval 4000 --radiolist "asldkjf" 12 20 3 ' c='green'}}1 "first choice" off 2 "second choice" on 3 "third choice" off{{color text=' 2>&1)' c='green'}}**
Additions:
[[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.
Deletions:
Additions:
**{{color text='Xdialog --timeout 2 --yesno "Choose" 0 0 ; a=$?' c='green'}}**
**{{color text='for i in {0..100..10} ; do echo $i ; sleep 1 ; done | Xdialog --gauge "Ten second countdown" 0 0' c='green'}}**
**{{color text='b=$(Xdialog --inputbox "application to run" 0 0 2>&1)' c='green'}}**
**{{color text='b=$(Xdialog --radiolist "Sound" 12 20 3 ' c='green'}}tag1 "PC" off tag2 "HDMI" on tag3 "BT" off{{color text=' 2>&1)' c='green'}}**
**{{color text='b=$(Xdialog --menubox "Choose wifi adapter to connect" 10 42 8 ' c='green'}}tag1 "card0" tag2 "card1" tag3 "wifi off" {{color text=' 2>&1)' c='green'}}**
**{{color text='b=$(Xdialog --checklist "$1" 12 32 12 ' c='green'}} tag1 "Save" on tag2 "Reboot" off tag3 "Shut down" on {{color text=' 2>&1)' c='green'}}**
**{{color text='Xdialog --infobox "important message" 0 0 2000' c='green'}}**
**{{color text='while true ; do echo -e "XXX\n`date`\nXXX" ; sleep 1 ; done | Xdialog --infobox "Initial text" 8 60 0' c='green'}}**
**{{color text='b=(Xdialog --timeout 4 --interval 4000 --radiolist "asldkjf" 12 20 3 ' c='green'}}1 "first choice" off 2 "second choice" on 3 "third choice" off{{color text=' 2>&1)' c='green'}}**
**{{color text='b=$(Xdialog --timeout 4 --interval 200 --menubox "text" 10 42 8' c='green'}} 1 "first choice" 2 "second choice" 3 "third choice"{{color text=' 2>&1)' c='green'}} **
**{{color text='for i in {0..100..10} ; do echo $i ; sleep 1 ; done | Xdialog --gauge "Ten second countdown" 0 0' c='green'}}**
**{{color text='b=$(Xdialog --inputbox "application to run" 0 0 2>&1)' c='green'}}**
**{{color text='b=$(Xdialog --radiolist "Sound" 12 20 3 ' c='green'}}tag1 "PC" off tag2 "HDMI" on tag3 "BT" off{{color text=' 2>&1)' c='green'}}**
**{{color text='b=$(Xdialog --menubox "Choose wifi adapter to connect" 10 42 8 ' c='green'}}tag1 "card0" tag2 "card1" tag3 "wifi off" {{color text=' 2>&1)' c='green'}}**
**{{color text='b=$(Xdialog --checklist "$1" 12 32 12 ' c='green'}} tag1 "Save" on tag2 "Reboot" off tag3 "Shut down" on {{color text=' 2>&1)' c='green'}}**
**{{color text='Xdialog --infobox "important message" 0 0 2000' c='green'}}**
**{{color text='while true ; do echo -e "XXX\n`date`\nXXX" ; sleep 1 ; done | Xdialog --infobox "Initial text" 8 60 0' c='green'}}**
**{{color text='b=(Xdialog --timeout 4 --interval 4000 --radiolist "asldkjf" 12 20 3 ' c='green'}}1 "first choice" off 2 "second choice" on 3 "third choice" off{{color text=' 2>&1)' c='green'}}**
**{{color text='b=$(Xdialog --timeout 4 --interval 200 --menubox "text" 10 42 8' c='green'}} 1 "first choice" 2 "second choice" 3 "third choice"{{color text=' 2>&1)' c='green'}} **
Deletions:
{{color text='for i in {0..100..10} ; do echo $i ; sleep 1 ; done | Xdialog --gauge "Ten second countdown" 0 0' c='green'}}
{{color text='b=$(Xdialog --inputbox "application to run" 0 0 2>&1)' c='green'}}
{{color text='b=$(Xdialog --radiolist "Sound" 12 20 3 ' c='green'}}tag1 "PC" off tag2 "HDMI" on tag3 "BT" off{{color text=' 2>&1)' c='green'}}
{{color text='b=$(Xdialog --menubox "Choose wifi adapter to connect" 10 42 8 ' c='green'}}tag1 "card0" tag2 "card1" tag3 "wifi off" {{color text=' 2>&1)' c='green'}}
{{color text='b=$(Xdialog --checklist "$1" 12 32 12 ' c='green'}} tag1 "Save" on tag2 "Reboot" off tag3 "Shut down" on {{color text=' 2>&1)' c='green'}}
{{color text='Xdialog --infobox "important message" 0 0 2000' c='green'}}
{{color text='while true ; do echo -e "XXX\n`date`\nXXX" ; sleep 1 ; done | Xdialog --infobox "Initial text" 8 60 0' c='green'}}
{{color text='b=(Xdialog --timeout 4 --interval 4000 --radiolist "asldkjf" 12 20 3 ' c='green'}}1 "first choice" off 2 "second choice" on 3 "third choice" off{{color text=' 2>&1)' c='green'}}
{{color text='b=$(Xdialog --timeout 4 --interval 200 --menubox "text" 10 42 8' c='green'}} 1 "first choice" 2 "second choice" 3 "third choice"{{color text=' 2>&1)' c='green'}}
Additions:
{{color text='b=$(Xdialog --inputbox "application to run" 0 0 2>&1)' c='green'}}
Deletions:
Additions:
(2000 is timeout in ms; 0 = no timeout)
Deletions:
Additions:
[[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. Please add useful examples if you have them.
Deletions:
[[http://web.mit.edu/outland/share/doc/Xdialog-2.1.2/index.html Xdialog documentation]]