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
|
#!/bin/sh --
# shell wrapper to avoid typing Menu escape sequences
if test $# -eq 0; then
echo "\
usage: `basename $0` cmd
where the most common commands are
[menu] [menu:name]
[read:file] [read:file;name]
[title:string]
+/path/menu
+/path/menu/*
+/menu/path/{-}
+/menu/path/{item}{rtext} action
-/*
-/path/menu
-/path/menu/*
-/path/{-}
-/path/{item}
<b>Begin<r>Right<l>Left<u>Up<d>Down<e>End
[done]
[rm] [rm:] [rm*] [rm:*] [rm:name]
[swap] [prev] [next]
[clear] [show] [hide]
[pixmap:file]
[dump]
NB: commands may need to be quoted to avoid shell expansion
"
exit
fi
Echo="echo -n"
# some systems/shells don't like `echo -n'
case `/bin/uname` in
SunOS) Echo="echo";;
esac
while [ $# -gt 0 ]
do
case $1 in
+* | -* | '<'* | '['*) # send raw commands
$Echo "]10;$1"
;;
*) # read in menu files
if test $1 = "default";
then
$Echo "]10;[read:$0]"
else
$Echo "]10;[read:$1]"
fi
if test "$COLORTERM" != "rxvt-xpm"; # remove pixmap stuff
then
$Echo "]10;[menu][:-/Terminal/Pixmap:][show]"
fi
;;
esac
shift
done
|