summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-11-03 03:42:07 +0000
committerjao <jao@gnu.org>2021-11-03 03:42:07 +0000
commit1568c6ea16bae57cf7aa33b8d0d7c1b958de93f2 (patch)
tree784bbad2918e440260e72e1380289b84254cfdc0
parent4699bf61a37f044d0bf3035fc0907d8ecd5bea12 (diff)
downloadelibs-1568c6ea16bae57cf7aa33b8d0d7c1b958de93f2.tar.gz
elibs-1568c6ea16bae57cf7aa33b8d0d7c1b958de93f2.tar.bz2
exwm: better floating transient
-rw-r--r--exwm.org64
1 files changed, 29 insertions, 35 deletions
diff --git a/exwm.org b/exwm.org
index c6ef897..69ec61d 100644
--- a/exwm.org
+++ b/exwm.org
@@ -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)