-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmain
More file actions
executable file
·64 lines (49 loc) · 1.39 KB
/
main
File metadata and controls
executable file
·64 lines (49 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# -*- mode:sh -*-
# This must be done in two steps if the value is to be globally accessible:
# comargs="--title=\"Using Common YAD Arguments\" --center --width=400 --text-align=center --buttons-layout=center --borders=10 --image=\"/usr/share/icons/Adwaita/48x48/emotes/face-cool.png\""
comargs=(
--center
--text-align=center
--buttons-layout=center
--borders=10
# --image="/usr/share/icons/Advaita/48x48/emotes/face-cool.png"
--image="bogus-missing-image"
)
declare -x COMARGS=$( printf "%q " "${comargs[@]}" )
gcomargs=( $( printf "%s " "${COMARGS}" ) )
# echo "${#gcomargs[@]} elements in gcomargs"
yad_message()
{
msg="$1"
txt="value of msg: $1"
mapfile -t lcomargs < <( printf "%s" "${COMARGS}" | xargs -n 1 printf "%s\n" )
yad "${lcomargs[@]}" --text="$txt" --button="Done":1
}
open_utilities()
{
cd utilities
./utilities
}
cmdmain=(
yad
"${comargs[@]}"
--text="Click a link to see the demos."
--button="Exit":1
--form
--field="YAD Button Processing":btn "./yadbuttons"
--field="YAD Dialog Formatting":btn "./yadformatting"
--field="YAD Data Transfer":btn "./yaddata"
--field="Utilities":btn "bash -c open_utilities"
)
export -f yad_message
export -f open_utilities
while true; do
"${cmdmain[@]}"
exval=$?
case $exval in
1|252) break;;
esac
done
unset open_utilities
unset yad_message