summaryrefslogtreecommitdiffstats
path: root/doc/scriptexamples/runmenu/runmenu.kvs
diff options
context:
space:
mode:
Diffstat (limited to 'doc/scriptexamples/runmenu/runmenu.kvs')
-rw-r--r--doc/scriptexamples/runmenu/runmenu.kvs111
1 files changed, 111 insertions, 0 deletions
diff --git a/doc/scriptexamples/runmenu/runmenu.kvs b/doc/scriptexamples/runmenu/runmenu.kvs
new file mode 100644
index 0000000..dea6a27
--- /dev/null
+++ b/doc/scriptexamples/runmenu/runmenu.kvs
@@ -0,0 +1,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 :)