added an option for user-defined bindings with "xterm" on F2 as the default

This commit is contained in:
frese 2003-05-01 14:02:54 +00:00
parent 2ad315e33d
commit 0598918d0c
1 changed files with 15 additions and 1 deletions

View File

@ -22,6 +22,7 @@
(create-workspace keys "F9") (create-workspace keys "F9")
(create-workspace-question string "What kind of manager do you want in the new workspace?\n(S)witch or (M)ove windowmanager:") (create-workspace-question string "What kind of manager do you want in the new workspace?\n(S)witch or (M)ove windowmanager:")
(kill-client keys "M-c") (kill-client keys "M-c")
(user-bindings binding-list '(("F2" exec "xterm")))
) )
(define-record-type root-wm :root-wm (define-record-type root-wm :root-wm
@ -67,6 +68,10 @@
execute attach quit execute attach quit
create-workspace create-workspace
kill-client)) kill-client))
(for-each (lambda (binding)
(grab-shortcut dpy window (car binding) (cons 'binding binding)
in-channel #t))
(get-option-value options 'user-bindings))
(spawn* '(root-wm) (spawn* '(root-wm)
(lambda (release) (lambda (release)
@ -316,7 +321,16 @@
'(#\y #\Y #\n #\N) #f))) '(#\y #\Y #\n #\N) #f)))
(if (memq a '(#\y #\Y)) (if (memq a '(#\y #\Y))
(exit #t)))) (exit #t))))
(else (warn "unhandled root message" msg)))) (else
(if (and (pair? (car msg)) (eq? 'binding (car (car msg))))
(let* ((binding (cdr (car msg)))
(time (second msg))
(command (cdr binding)))
(mdisplay "binding: " binding " command: " command "\n")
(case (car command)
((exec) (run (sh -c ,(string-append (cadr command) " &"))))
(else (warn "unknown binding command" command))))
(warn "unhandled root message" msg)))))
(define (exec-complete str pos) (define (exec-complete str pos)
;; TODO ;; TODO