diff --git a/src/root-manager.scm b/src/root-manager.scm index da94e89..475da6e 100644 --- a/src/root-manager.scm +++ b/src/root-manager.scm @@ -22,6 +22,7 @@ (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:") (kill-client keys "M-c") + (user-bindings binding-list '(("F2" exec "xterm"))) ) (define-record-type root-wm :root-wm @@ -67,6 +68,10 @@ execute attach quit create-workspace 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) (lambda (release) @@ -316,7 +321,16 @@ '(#\y #\Y #\n #\N) #f))) (if (memq a '(#\y #\Y)) (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) ;; TODO