File: menu

package info (click to toggle)
aterm 1.0.0-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,432 kB
  • ctags: 1,431
  • sloc: ansic: 14,688; sh: 3,391; makefile: 250
file content (83 lines) | stat: -rwxr-xr-x 1,668 bytes parent folder | download | duplicates (24)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/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
exit	# stop shell here!
#-------------------------------------------------------------------------
# since everything before a [menu] tag is ignored, we can put a default
# menu here
#-------------------------------------------------------------------------
[menu:default]

/Programs/*
{Edit}		${EDITOR:-vi}\r
{Top}		top\r
{Dir}		ls -la|${PAGER:-more}\r
{Dir-Time}	ls -lat|${PAGER:-more}\r
{Space Left}	df\r
{-}
{Exit}		exit\r

/Shell/*
{check mail}	checkmail\r
{Background}	^Z bg\r
{Kill}		^C\r

[show]
[done]
#--------------------------------------------------------------------- eof