EXWM: Add exwm-start-in-char-mode

master
Pierre Neidhardt 2017-10-11 17:45:45 +01:00
parent e5f7a672ac
commit 13bd381d7f
1 changed files with 8 additions and 0 deletions

View File

@ -81,6 +81,8 @@ If there is none, fire it up."
(if (and (eq major-mode 'exwm-mode)
(string-match
;; Only match against the end as some window names are hard to predict, e.g. "Mozilla Firefox".
;; `exwm-instance-name' is sadly not predictable either: Firefox is "Navigator".
;; `exwm-class-name' might be better.
(format "%s$" (regexp-quote (file-name-nondirectory browse-url-generic-program)))
(downcase (buffer-name (current-buffer)))))
(start-process-shell-command browse-url-generic-program nil browse-url-generic-program)
@ -139,4 +141,10 @@ If there is none, fire it up."
(setq initial-buffer-choice
(lambda () (get-buffer "*Warnings*"))))))
;;; Some programs such as 'emacs' are better off being started in char-mode.
(defun exwm-start-in-char-mode ()
(when (string= exwm-instance-name "emacs")
(exwm-input-release-keyboard (exwm--buffer->id (window-buffer)))))
(add-hook 'exwm-manage-finish-hook 'exwm-start-in-char-mode)
(provide 'init-exwm)