[exwm] disable package; tweak my-start-app-or-switch to cope

This commit is contained in:
contrapunctus 2021-09-01 17:44:07 +05:30
parent 033937f5d6
commit e484313852
1 changed files with 13 additions and 13 deletions

View File

@ -84,8 +84,7 @@ This needs to be before =boon=/=exwm=, or you get a "failed to define function i
(ivy-mode))
#+END_SRC
** exwm
#+BEGIN_SRC emacs-lisp
(require 'exwm)
#+BEGIN_SRC emacs-lisp :load no :tangle no
(setq exwm-input-global-keys
'(([?\C-1] . select-window-1)
([?\C-2] . select-window-2)
@ -111,13 +110,13 @@ This needs to be before =boon=/=exwm=, or you get a "failed to define function i
([?\s-v] . exwm-input-toggle-keyboard)))
#+END_SRC
Use window title for buffer names.
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp :load no :tangle no
(require 'exwm)
(add-hook 'exwm-update-title-hook
(lambda ()
(exwm-workspace-rename-buffer exwm-title)))
(exwm-enable)
#+END_SRC
*** Helpers
A less repetitive way to start processes. Also enables Boon in the process buffer, so I can easy navigate it, copy text in it, or switch away from it.
#+BEGIN_SRC emacs-lisp
@ -136,15 +135,16 @@ A less repetitive way to start processes. Also enables Boon in the process buffe
NAME is the name of the process and its buffer."
(let* ((name (if name name program))
(regex (or class-re title-re program))
(buffer (seq-find
(lambda (buffer)
(with-current-buffer buffer
(if title-re
(and exwm-title
(string-match-p title-re exwm-title))
(and exwm-class-name
(string-match-p regex exwm-class-name)))))
(buffer-list))))
(buffer (when (featurep 'exwm)
(seq-find
(lambda (buffer)
(with-current-buffer buffer
(if title-re
(and exwm-title
(string-match-p title-re exwm-title))
(and exwm-class-name
(string-match-p regex exwm-class-name)))))
(buffer-list)))))
(if buffer (switch-to-buffer buffer)
(apply #'my-start-process program name args))))
#+END_SRC