From d17e6c9ef6a14bbdf42233aef06d59ee0ab3b831 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Thu, 13 Mar 2025 14:18:08 +0300 Subject: [PATCH] uconsole: more keybindings --- .emacs.d/desktop.el | 43 ++++++++++++++++++++++++++++++++----------- Desktop.org | 43 ++++++++++++++++++++++++++++++++----------- 2 files changed, 64 insertions(+), 22 deletions(-) diff --git a/.emacs.d/desktop.el b/.emacs.d/desktop.el index 6b82850..f7d3162 100644 --- a/.emacs.d/desktop.el +++ b/.emacs.d/desktop.el @@ -572,7 +572,9 @@ _d_: Discord (equal (system-name) "amaranth")) (my/run-in-background "set_layout")) (add-hook 'exwm-workspace-switch-hook - #'my/exwm-store-last-workspace)) + #'my/exwm-store-last-workspace) + (when my/is-uconsole + (set-face-attribute 'default nil :height 140))) (defun my/exwm-update-class () (exwm-workspace-rename-buffer (format "EXWM :: %s" exwm-class-name))) @@ -712,16 +714,35 @@ _d_: Discord (y-or-n-p (format "Create workspace %d" ,i))) (exwm-workspace-switch-create ,i) )))) (number-sequence 0 9)) - ,@(mapcar (lambda (i) - (when (= i 0) - (setq i 10)) - `(,(kbd (format "s-" i)) . - (lambda () - (interactive) - (when (or (< ,i (exwm-workspace--count)) - (y-or-n-p (format "Create workspace %d" ,i))) - (exwm-workspace-switch-create ,i) )))) - (number-sequence 0 9)))) + + ,@(when my/is-uconsole + `( + ,@(mapcar (lambda (i) + (when (= i 0) + (setq i 10)) + `(,(kbd (format "s-" i)) . + (lambda () + (interactive) + (when (or (< ,i (exwm-workspace--count)) + (y-or-n-p (format "Create workspace %d" ,i))) + (exwm-workspace-switch-create ,i) )))) + (number-sequence 0 9)) + + (,(kbd "M-") . (lambda () (interactive) (my/exwm-windmove 'left))) + (,(kbd "M-") . (lambda () (interactive) (my/exwm-windmove 'right))) + (,(kbd "M-") . (lambda () (interactive) (my/exwm-windmove 'up))) + (,(kbd "M-") . (lambda () (interactive) (my/exwm-windmove 'down))) + + (,(kbd "M-,") . persp-prev) + (,(kbd "M-.") . persp-next) + + (,(kbd "M-r") . my/exwm-resize-hydra/body) + + (,(kbd "M-p") . app-launcher-run-app) + (,(kbd "M-P") . async-shell-command) + (,(kbd "M-;") . my/exwm-apps-hydra/body) + (,(kbd "M--") . password-store-completion) + )))) (defun exwm-input--fake-last-command () "Fool some packages into thinking there is a change in the buffer." diff --git a/Desktop.org b/Desktop.org index 19cd5ce..64e7ed1 100644 --- a/Desktop.org +++ b/Desktop.org @@ -937,16 +937,35 @@ And keybindings that are available in both =char-mode= and =line-mode=: (y-or-n-p (format "Create workspace %d" ,i))) (exwm-workspace-switch-create ,i) )))) (number-sequence 0 9)) - ,@(mapcar (lambda (i) - (when (= i 0) - (setq i 10)) - `(,(kbd (format "s-" i)) . - (lambda () - (interactive) - (when (or (< ,i (exwm-workspace--count)) - (y-or-n-p (format "Create workspace %d" ,i))) - (exwm-workspace-switch-create ,i) )))) - (number-sequence 0 9)))) + + ,@(when my/is-uconsole + `( + ,@(mapcar (lambda (i) + (when (= i 0) + (setq i 10)) + `(,(kbd (format "s-" i)) . + (lambda () + (interactive) + (when (or (< ,i (exwm-workspace--count)) + (y-or-n-p (format "Create workspace %d" ,i))) + (exwm-workspace-switch-create ,i) )))) + (number-sequence 0 9)) + + (,(kbd "M-") . (lambda () (interactive) (my/exwm-windmove 'left))) + (,(kbd "M-") . (lambda () (interactive) (my/exwm-windmove 'right))) + (,(kbd "M-") . (lambda () (interactive) (my/exwm-windmove 'up))) + (,(kbd "M-") . (lambda () (interactive) (my/exwm-windmove 'down))) + + (,(kbd "M-,") . persp-prev) + (,(kbd "M-.") . persp-next) + + (,(kbd "M-r") . my/exwm-resize-hydra/body) + + (,(kbd "M-p") . app-launcher-run-app) + (,(kbd "M-P") . async-shell-command) + (,(kbd "M-;") . my/exwm-apps-hydra/body) + (,(kbd "M--") . password-store-completion) + )))) #+end_src A function to apply changes to =exwm-input-global-keys=. @@ -1229,7 +1248,9 @@ And the EXWM config itself. (equal (system-name) "amaranth")) (my/run-in-background "set_layout")) (add-hook 'exwm-workspace-switch-hook - #'my/exwm-store-last-workspace)) + #'my/exwm-store-last-workspace) + (when my/is-uconsole + (set-face-attribute 'default nil :height 140))) (defun my/exwm-update-class () (exwm-workspace-rename-buffer (format "EXWM :: %s" exwm-class-name)))