diff options
-rw-r--r-- | exwm.org | 64 |
1 files changed, 29 insertions, 35 deletions
@@ -441,55 +441,49 @@ #+end_src * Transients #+begin_src emacs-lisp - (defmacro jao-exwm--mover (x y dx dy) - `(progn - (defun ,(intern (format "jao-exwm-move-%d-%d" dx dy)) () - ,(format "Nudge window by %d, %s" dx dy) - (interactive) - (exwm-floating-move ,dx ,dy)) - (defun ,(intern (format "jao-exwm-float-to-%d-%d" x y)) () - ,(format "Move window to %d, %s" x y) - (interactive) - (jao-exwm--float-to ,x ,y)) - (defun ,(intern (format "jao-exwm-enlarge-%d-%d" dx dy)) () - ,(format "Enlarge window by %d, %s" dx dy) - (interactive) - (exwm-layout-enlarge-window ,(if (zerop dx) dy dx) ,(zerop dx))))) - - (jao-exwm--mover 20 -20 0 -5) - (jao-exwm--mover 20 20 0 5) - (jao-exwm--mover -20 20 5 0) - (jao-exwm--mover -20 -20 -5 0) - (defun jao-exwm--floating-p () exwm--floating-frame) - (transient-define-prefix jao-transient-float () "Operations on EXWM floating windows." - :transient-non-suffix 'transient--do-quit-one + ;; :transient-non-suffix 'transient--do-quit-one [["Float" ("f" "float" exwm-floating-toggle-floating) ("F" "full" exwm-layout-toggle-fullscreen) - ("c" "center" jao-exwm--center-float :if jao-exwm--floating-p)] + ("c" "center" jao-exwm--center-float :if jao-exwm--floating-p) + ("C" "center-float" jao-exwm--def-center-float)] ["Slide" :if jao-exwm--floating-p - ("k" "up" jao-exwm-move-0--5 :transient t) - ("j" "down" jao-exwm-move-0-5 :transient t) - ("h" "left" jao-exwm-move--5-0 :transient t) - ("l" "right" jao-exwm-move-5-0 :transient t)] + ("k" "up" (lambda () (interactive) (exwm-floating-move 0 -5)) + :transient t) + ("j" "down" (lambda () (interactive) (exwm-floating-move 0 5)) + :transient t) + ("h" "left" (lambda () (interactive) (exwm-floating-move -5 0)) + :transient t) + ("l" "right" (lambda () (interactive) (exwm-floating-move 5 0)) + :transient t)] ["Resize" :if jao-exwm--floating-p - ("K" "up" jao-exwm-enlarge-5-0 :transient t) - ("J" "down" jao-exwm-enlarge--5-0 :transient t) - ("H" "left" jao-exwm-enlarge-0-5 :transient t) - ("L" "right" jao-exwm-enlarge-0--5 :transient t)] + ("K" "up" + (lambda () (interactive) (exwm-layout-enlarge-window 5)) :transient t) + ("J" "down" + (lambda () (interactive) (exwm-layout-enlarge-window -5)) :transient t) + ("H" "left" jao-exwm-enlarge-0-5 + (lambda () (interactive) (exwm-layout-enlarge-window 5 t)) :transient t) + ("L" "right" + (lambda () (interactive) (exwm-layout-enlarge-window -5 t)) + :transient t)] ["Nudge" :if jao-exwm--floating-p - ("tl" "top-left" jao-exwm-float-to-20-20) - ("tr" "top-right" jao-exwm-float-to--20-20) - ("bl" "bottom-left" jao-exwm-float-to-20--20) - ("br" "bottom-right " jao-exwm-float-to--20--20)]]) + ("tl" "top-left" + (lambda () (interactive) (jao-exwm--float-to 20 20))) + ("tr" "top-right" + (lambda () (interactive) (jao-exwm--float-to -20 20))) + ("bl" "bottom-left" + (lambda () (interactive) (jao-exwm--float-to 20 -20))) + ("br" "bottom-right " + (lambda () (interactive) (jao-exwm--float-to -20 -20)))]]) (transient-define-prefix jao-transient-exwm () "Global operations in EXWM." + :transient-non-suffix 'transient--do-quit-one [["Notes" ("n" "capture note" jao-org-notes-open-or-create) ("/" "search notes" jao-org-notes-open) |