diff --git a/src/split-wm.scm b/src/split-wm.scm index 5006752..ac5cb5b 100644 --- a/src/split-wm.scm +++ b/src/split-wm.scm @@ -5,6 +5,10 @@ (resize-step int 5) (bar-style symbol 'raised) ;; raised | sunken | flat (bar-colors colors '("#dddddd" "#888888" "#333333")) + (select-right keys "M-Right") + (select-left keys "M-Left") + (select-up keys "M-Up") + (select-down keys "M-Down") ) ;; ---------- ---------- @@ -40,17 +44,29 @@ (fit-windows wm resizer-window first-client second-client)) ((init-client) - (let ((client (second msg))) - (if first-client - (set! second-client client) - (set! first-client client)) + (let ((client (second msg)) + (first? (not first-client))) + (if first? + (set! first-client client) + (set! second-client client)) + (set-window-border-width! dpy (client:window client) 0) (fit-windows wm resizer-window first-client second-client) (map-window dpy (client:client-window client)) ;;(select-client wm client))) ?? + + (let ((opt (if (eq? (get-option-value (wm:options wm) + 'orientation) + 'horizontal) + (if first? 'select-right 'select-left) + (if first? 'select-down 'select-up)))) + (grab-shortcut dpy (client:client-window client) + (get-option-value (wm:options wm) opt) + (if first? 'select-second 'select-first) + channel #f)) )) - + ((deinit-client) (let ((client (second msg))) (if (eq? client first-client) @@ -72,6 +88,15 @@ ((update-client-state) #t) + ;; Shortcuts + ((select-first) + (let ((time (second msg))) + (if first-client + (wm-select-client wm first-client time)))) + ((select-second) + (let ((time (second msg))) + (if second-client + (wm-select-client wm second-client time)))) )) (loop))))