blob: 06a0b2f45780a88cccdfce4fe1c79aa29df0cb1a (
plain)
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
|
#!/bin/sh
while test $# -gt 0; do
case $1 in
--apptitle)
apptitle="$2"
shift;shift
;;
--text)
text="$2"
shift;shift
;;
--title)
title="$2"
shift;shift
;;
--buttons)
buttons="$2"
shift;shift
;;
*)
echo "Unknown option $1"
exit 2
;;
esac
done
first_button="$(printf "%s" "$buttons" | cut -d';' -f1)"
set -- --ok-label "$first_button"
while
buttons="$(printf "%s" "$buttons" | cut -d';' -f1 --complement)"
test -n "$buttons"
do
set -- "$@" --extra-button "$(printf "%s" "$buttons" | cut -d';' -f1)"
done
#$(printf "%s" "$2" | sed 's/;$/"/g' | sed 's/;/" --extra-button "/g')
#printf "%s" "$extra_buttons"
echo "$@"
# shellcheck disable=SC2086
zenity --info --title "${title:-$apptitle}" --text "$text" "$@" && printf "%s\n" "$first_button"
|