summaryrefslogtreecommitdiffstats
path: root/doc/scriptexamples/runmenu/runmenu.kvs
blob: dea6a27d3d8ff3c841dd0701f5dafe3f54408500 (plain)
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# This simple script adds a sample "run external program" popup
# to your menubar
# This is just a sample popup... you will probably
# want to add/remove entries here
# This will also work mainly on unix... windows has not so much
# proggies to be run as example


# Define the popup with run entries...
# You prolly will change a lot here :)

defpopup(runmenu)
{
	popup(Terminal,138)
	{
		item(XTerm,25) ($system.ostype == unix)
		{
			run xterm
		}

		item(Konsole,151) ($system.ostype == unix)
		{
			run konsole
		}

		item(ETerm,25) ($system.ostype == unix)
		{
			run eterm
		}
	}

	popup(Browser,172)
	{
		item(konqueror,135) ($system.ostype == unix)
		{
			run konqueror
		}

		item(netscape,164)
		{
			if($system.ostype == unix)run kvi_run_netscape
			else run netscape.exe
		}
	}

	popup(Multimedia,177)
	{
		item(xmms)
		{
			run xmms
		}
		item(mplayer)
		{
			run mplayer
		}
		item(kscd)
		{
			run kscd
		}
	}

	popup(Utils)
	{
		item(xcalc)
		{
			run xcalc;
		}
		item(kcalc)
		{
			run kcalc;
		}
	}

	separator;

	# Let's allow to run an user specified command

	item(Run...,183)
	{
		dialog.textinput(Run,<center>Please enter the command name</center>,Ok,Cancel)
		{
			if($0 == 0 && $1)run $1
		}
	}

	separator;

	# This is an interesting item
	# It allows this script to be uninstalled :)

	popup(Uninstall,110)
	{
		item(Uninstall this menu,110)
		{
			timer -s (runmenu_uninstall,0){ defpopup(runmenu){}; }
		}
	}
}

# add it to the menubar of each new frame

event(OnFrameWindowCreated,runmenu)
{
	setmenu -i=3 "&Run" runmenu
}

# set it also just now, in the current frame

setmenu -i=3 "&Run" runmenu

# done :)