Created
June 12, 2018 20:55
-
-
Save sjl/309fa7e58d0fcfab7d1a657c159f12ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defcommand move-focus* (direction) | |
((:direction "Enter a direction: ")) | |
(labels ((in-float-p () | |
(typep (current-group) 'float-group)) | |
(focus-first-frame () | |
(unless (in-float-p) | |
(dotimes (i 10) | |
(move-focus (ecase direction | |
(:left :right) | |
(:right :left)))))) | |
(next-group () | |
(ecase direction | |
(:right (gnext)) | |
(:left (gprev))) | |
(focus-first-frame))) | |
(unless (in-float-p) | |
(banish)) | |
(if (in-float-p) | |
(next-group) | |
(let ((frame (current-frame))) | |
(move-focus direction) | |
(when (eql frame (current-frame)) | |
(next-group)))))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment