"SfR Fresh" - the SfR Freeware/Shareware Archive

Member "xiterm-2.0/doc/test/menus/menu" of archive xiterm-2.0.tar.gz:


As a special service "SfR Fresh" has tried to format the requested source page into HTML format using source code syntax highlighting with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
    1 #!/bin/sh --
    2 # shell wrapper to avoid typing Menu escape sequences
    3 if test $# -eq 0; then
    4 echo "\
    5 usage: `basename $0` cmd
    6 where 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]
   29 NB: commands may need to be quoted to avoid shell expansion
   30 "
   31 exit
   32 fi
   33 Echo="echo -n"
   34 # some systems/shells don't like `echo -n'
   35 case `/bin/uname` in
   36     SunOS) Echo="echo";;
   37 esac
   38 while [ $# -gt 0 ]
   39 do
   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
   59 done
   60 exit	# 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}		${EDITOR:-vi}\r
   69 {Top}		top\r
   70 {Dir}		ls -la|${PAGER:-more}\r
   71 {Dir-Time}	ls -lat|${PAGER:-more}\r
   72 {Space Left}	df\r
   73 {-}
   74 {Exit}		exit\r
   75 
   76 /Shell/*
   77 {check mail}	checkmail\r
   78 {Background}	^Z bg\r
   79 {Kill}		^C\r
   80 
   81 [show]
   82 [done]
   83 #--------------------------------------------------------------------- eof