summaryrefslogtreecommitdiff
path: root/utility_examples
diff options
context:
space:
mode:
Diffstat (limited to 'utility_examples')
-rwxr-xr-xutility_examples/gauge_example.sh20
-rwxr-xr-xutility_examples/info_example.sh3
-rwxr-xr-xutility_examples/menu_example.sh41
-rwxr-xr-xutility_examples/message_example.sh5
-rwxr-xr-xutility_examples/mixedform_example.sh25
-rwxr-xr-xutility_examples/mixedgauge_example.sh24
6 files changed, 118 insertions, 0 deletions
diff --git a/utility_examples/gauge_example.sh b/utility_examples/gauge_example.sh
new file mode 100755
index 000000000000..b17f20274c79
--- /dev/null
+++ b/utility_examples/gauge_example.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+input="A B C D E F G"
+total=`echo $input | awk '{print split($0, a)}'`
+curr=1
+for i in $input
+do
+ sleep 1
+ perc="$(expr $(expr $curr "*" 100 ) "/" $total )"
+ echo XXX
+ echo $perc
+ echo "[$curr/$total] Input: $i"
+ echo XXX
+ if [ $curr -eq $total ]
+ then
+ echo EOF
+ fi
+ curr=`expr $curr + 1`
+done | ./bsddialog --title gauge --gauge "[0/$total] Starting..." 10 70 0
+
diff --git a/utility_examples/info_example.sh b/utility_examples/info_example.sh
new file mode 100755
index 000000000000..a57afa5fad88
--- /dev/null
+++ b/utility_examples/info_example.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+./bsddialog --sleep 5 --title infobox --infobox "Hello World!\n5 seconds" 6 20 \ No newline at end of file
diff --git a/utility_examples/menu_example.sh b/utility_examples/menu_example.sh
new file mode 100755
index 000000000000..dc41279a6b71
--- /dev/null
+++ b/utility_examples/menu_example.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+./bsddialog --title menu --menu "Hello World!" 15 30 5 \
+ "Tag 1" "DESC 1 xyz" \
+ "Tag 2" "DESC 2 xyz" \
+ "Tag 3" "DESC 3 xyz" \
+ "Tag 4" "DESC 4 xyz" \
+ "Tag 5" "DESC 5 xyz" \
+ 2>out.txt ; cat out.txt ; rm out.txt
+
+./bsddialog --title checklist --checklist "Hello World!" 15 30 5 \
+ "Tag 1" "DESC 1 xyz" on \
+ "Tag 2" "DESC 2 xyz" off \
+ "Tag 3" "DESC 3 xyz" on \
+ "Tag 4" "DESC 4 xyz" off \
+ "Tag 5" "DESC 5 xyz" on \
+ 2>out.txt ; cat out.txt ; rm out.txt
+
+./bsddialog --title radiolist --radiolist "Hello World!" 15 30 5 \
+ "Tag 1" "DESC 1 xyz" off \
+ "Tag 2" "DESC 2 xyz" off \
+ "Tag 3" "DESC 3 xyz" on \
+ "Tag 4" "DESC 4 xyz" off \
+ "Tag 5" "DESC 5 xyz" off \
+ 2>out.txt ; cat out.txt ; rm out.txt
+
+./bsddialog --title buildlist --buildlist "Hello World!" 15 40 5 \
+ "Tag 1" "DESC 1 xyz" off \
+ "Tag 2" "DESC 2 xyz" off \
+ "Tag 3" "DESC 3 xyz" on \
+ "Tag 4" "DESC 4 xyz" off \
+ "Tag 5" "DESC 5 xyz" off \
+ 2>out.txt ; cat out.txt ; rm out.txt
+
+./bsddialog --title treeview --treeview "Hello World!" 15 40 5 \
+ 0 "Tag 1" "DESC 1 xyz" off \
+ 1 "Tag 2" "DESC 2 xyz" off \
+ 2 "Tag 3" "DESC 3 xyz" on \
+ 1 "Tag 4" "DESC 4 xyz" off \
+ 1 "Tag 5" "DESC 5 xyz" off \
+ 2>out.txt ; cat out.txt ; rm out.txt
diff --git a/utility_examples/message_example.sh b/utility_examples/message_example.sh
new file mode 100755
index 000000000000..ac9dcc6e48b6
--- /dev/null
+++ b/utility_examples/message_example.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+./bsddialog --title msgbox --msgbox "Hello World!" 6 20
+
+./bsddialog --title yesno --yesno "Hello World!" 6 25 \ No newline at end of file
diff --git a/utility_examples/mixedform_example.sh b/utility_examples/mixedform_example.sh
new file mode 100755
index 000000000000..079805996dad
--- /dev/null
+++ b/utility_examples/mixedform_example.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+./bsddialog --title mixedform --mixedform "Hello World!" 12 40 5 \
+ Label: 1 1 Entry 1 11 18 25 0 \
+ Label: 2 1 Read-Only 2 11 18 25 2 \
+ Password: 3 1 Value2 3 11 18 25 1 \
+ Password: 4 1 Value4 4 11 18 25 3 \
+ Label5: 5 1 Value5 5 11 18 25 4 \
+ 2>out.txt ; cat out.txt ; rm out.txt
+
+./bsddialog --backtitle "BSD-2-Clause Licese" --title " form " --form "Hello World!" 12 40 5 \
+ Label1: 1 1 Value1 1 9 18 25 \
+ Label2: 2 1 Value2 2 9 18 25 \
+ Label3: 3 1 Value3 3 9 18 25 \
+ Label4: 4 1 Value4 4 9 18 25 \
+ Label5: 5 1 Value5 5 9 18 25 \
+ 2>out.txt ; cat out.txt ; rm out.txt
+
+./bsddialog --title passwordform --passwordform "Hello World!" 12 40 5 \
+ Password1: 1 1 Value1 1 12 18 25 \
+ Password2: 2 1 Value2 2 12 18 25 \
+ Password3: 3 1 Value3 3 12 18 25 \
+ Password4: 4 1 Value4 4 12 18 25 \
+ Password5: 5 1 Value5 5 12 18 25 \
+ 2>out.txt ; cat out.txt ; rm out.txt
diff --git a/utility_examples/mixedgauge_example.sh b/utility_examples/mixedgauge_example.sh
new file mode 100755
index 000000000000..900639f9ee84
--- /dev/null
+++ b/utility_examples/mixedgauge_example.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+input="A B C D E F G H"
+total=`echo $input | awk '{print split($0, a)}'`
+curr=1
+for i in $input
+do
+ perc="$(expr $(expr $curr "*" 100 ) "/" $total )"
+ curr=`expr $curr + 1`
+ ./bsddialog --title " mixedgauge " --mixedgauge "Hello World! Press <ENTER>" 20 35 $perc \
+ "Hidden!" 8 \
+ "Label 1" 0 \
+ "Label 2" 1 \
+ "Label 3" 2 \
+ "Label 4" 3 \
+ "Label 5" 4 \
+ "Label 6" 5 \
+ "Label 7" 6 \
+ "Label 8" 7 \
+ "Label 9" 9 \
+ "Label X" -- -$perc
+ #sleep 1
+done
+