1#!/bin/sh -- 2# shell wrapper to avoid typing Menu escape sequences 3if test $# -eq 0; then 4echo "\ 5usage: `basename $0` cmd 6where the most common commands are 7 [menu] [menu:name] 8 [read:file] [read:file;name] 9 [title:string] 10 +/path/menu 11 +/path/menu/* 12 +/menu/path/{-} 13 +/menu/path/{item}{rtext} action 14 15 -/* 16 -/path/menu 17 -/path/menu/* 18 -/path/{-} 19 -/path/{item} 20 21 <b>Begin<r>Right<l>Left<u>Up<d>Down<e>End 22 [done] 23 24 [rm] [rm:] [rm*] [rm:*] [rm:name] 25 [swap] [prev] [next] 26 [clear] [show] [hide] 27 [pixmap:file] 28 [dump] 29NB: commands may need to be quoted to avoid shell expansion 30" 31exit 32fi 33Echo="echo -n" 34# some systems/shells don't like `echo -n' 35case `/bin/uname` in 36 SunOS) Echo="echo";; 37esac 38while [ $# -gt 0 ] 39do 40 case $1 in 41 +* | -* | '<'* | '['*) # send raw commands 42 $Echo "]10;$1" 43 ;; 44 45 *) # read in menu files 46 if test $1 = "default"; 47 then 48 $Echo "]10;[read:$0]" 49 else 50 $Echo "]10;[read:$1]" 51 fi 52 if test "$COLORTERM" != "rxvt-xpm"; # remove pixmap stuff 53 then 54 $Echo "]10;[menu][:-/Terminal/Pixmap:][show]" 55 fi 56 ;; 57 esac 58 shift 59done 60exit # stop shell here! 61#------------------------------------------------------------------------- 62# since everything before a [menu] tag is ignored, we can put a default 63# menu here 64#------------------------------------------------------------------------- 65[menu:default] 66 67/Programs/* 68{Edit} vi\r 69{Top} top\r 70{Dir} ls -la|more\r 71{Dir-Time} ls -lat|more\r 72{Space Left} df\r 73{-} 74{Exit} exit\r 75 76/Shell/* 77{check mail} mail\r 78{Background} ^Z bg\r 79{Kill} ^C\r 80 81[show] 82[done] 83#--------------------------------------------------------------------- eof 84