+ New command APPLY in the user bindings

+ Use & to start new processes and support program arguments in the EXEC command

+ Document APPLY, extend documentation of EXEC
This commit is contained in:
mainzelm 2003-11-18 13:06:04 +00:00
parent d5f792b3d4
commit d632a308bd
3 changed files with 20 additions and 9 deletions

View File

@ -46,7 +46,7 @@
<h3>root-options</h3>
<table>
<table valign="top">
<tr>
<td><b>name</b></td>
<td><b>type</b></td>
@ -126,13 +126,23 @@
<td><code>user-bindings</code></td>
<td><code>binding-list</code></td>
<td><code>'(("F2" exec "xterm"))</code></td>
<td>List of user-defined key bindings.</td>
<td>List of user-defined key bindings. A binding consists of
the key to bind, a command and command arguments. Orion
currently supports the commands <code>exec</code> and
<code>apply</code>. The arguments of the <code>exec</code>
command should be the name of a program followed by
arguments to the program. Orion will execute this program
with the arguments. The <code>apply</code> command applies a
function, given as first command argument, to the arguments
starting at the second command argument.</td>
</tr>
<tr>
<td><code>execute</code></td>
<td><code>keys</code></td>
<td><code>"F3"</code></td>
<td>Shortcut for running a program.</td>
<td><code>execute</code></td> <td><code>keys</code></td>
<td><code>"F3"</code></td> <td>Shortcut for running a
program. A dialog will ask for the program to run. The TAB
key allows completion of the program name.</td>
</tr>
<tr>
<td><code>execute-question</code></td>

View File

@ -196,7 +196,7 @@
;; *** main package **************************************************
(define-structure scsh-things
(export ((run) :syntax))
(export ((run &) :syntax))
(open scsh))
(define-structure config

View File

@ -319,7 +319,7 @@
#f (finite-complete (executables-in-path)))))
(and exec
(not (string=? exec ""))
(run (sh -c ,(string-append exec " &"))))))
(& (exec)))))
((attach)
(let* ((cm (root-wm:current-manager root-wm))
(windows-above (window-path (wm:dpy cm) (wm:window cm)))
@ -363,7 +363,8 @@
(time (second msg))
(command (cdr binding)))
(case (car command)
((exec) (run (sh -c ,(string-append (cadr command) " &"))))
((exec) (& (,@(cdr command))))
((apply) (apply (cadr command) (cddr command)))
(else (warn "unknown binding command" command))))
(warn "unhandled root message" msg)))))