File: pdmenurc.complex.in

package info (click to toggle)
pdmenu 1.2.69
  • links: PTS
  • area: main
  • in suites: woody
  • size: 652 kB
  • ctags: 254
  • sloc: ansic: 2,012; sh: 297; perl: 75; makefile: 63
file content (52 lines) | stat: -rw-r--r-- 1,828 bytes parent folder | download | duplicates (4)
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
#!@PDMENU_BINDIR@/pdmenu
#
# This pdmenurc shows off the more complicated things that can be done with
# Pdmenu. If you get lost, see the pdmenurc(5) man page, or the simpler
# pdmenurc files.

# Define the main menu.
# Note the use of the preproc command to put the hostname in the menu title.
preproc:echo menu:main:`hostname` menu
	# Let's display a list of files in the current directory. Let the
	# user navigate around by hitting enter on subdirectories. Let them
	# display a file simply by hitting enter on it.
	# The showdir script can be in different places, depending on if
	# pdmenu has been installed yet or not, which is why I try running
	# it three different ways.
	group:_File viewer
		exec::makemenu: (\
			./showdir.pl `pwd` "" show_directory || \
			examples/showdir.pl `pwd` "" show_directory || \
			@PDMENU_LIBDIR@/pdmenu/showdir.pl `pwd` "" show_directory \
			) 2>/dev/null
		show:::show_directory
		remove:::show_directory
	endgroup
	# Display a list of users who are logged in, and talk to the one that
	# is selected.
	group:_Talk to someone
		exec::makemenu:\
			echo "menu:talk:Talk to someone:Select who to talk to" ; \
			for user in `users`; do \
		  		echo "exec:Talk to _$user:pause:talk $user" ; \
			done
		show:::talk
		remove:::talk
	endgroup
	show:_Torture test menu::torture
	nop
	exit:E_xit

menu:torture:Torture Test Menu:Don't try this at home..
	show:_Display this menu again::torture
	show:_Display main menu again::main
	group:_Add item to this menu
		exec::makemenu,edit:\
			echo "menu:torture:Torture Test Menu:Don't try this at home.."; \
			echo "exec:~Menu Item Title:~:pause:~Menu Item Command:~"
	endgroup
	group:_Add item to the main menu
		exec::makemenu,edit:\
			echo menu:main:`hostname` menu ; \
			echo "exec:~Menu Item Title:~:pause:~Menu Item Command:~"
	endgroup