mirror of
https://github.com/pestctrl/emacs-config.git
synced 2026-02-16 16:24:18 +00:00
Master branch of exwm seems to have fixed the firefox issue
This commit is contained in:
parent
c2ae9c9e30
commit
d9e5bb9e6b
4 changed files with 52 additions and 87 deletions
6
.gitmodules
vendored
6
.gitmodules
vendored
|
|
@ -13,3 +13,9 @@
|
|||
[submodule "custom/emacs-memoize"]
|
||||
path = custom/emacs-memoize
|
||||
url = https://github.com/skeeto/emacs-memoize
|
||||
[submodule "custom/exwm"]
|
||||
path = custom/exwm
|
||||
url = https://github.com/ch11ng/exwm
|
||||
[submodule "custom/xelb"]
|
||||
path = custom/xelb
|
||||
url = https://github.com/ch11ng/xelb
|
||||
|
|
|
|||
131
config.org
131
config.org
|
|
@ -82,102 +82,59 @@
|
|||
* EXWM
|
||||
** Config
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package exwm)
|
||||
;(use-package exwm)
|
||||
(add-to-list 'load-path "~/.emacs.d/custom/exwm")
|
||||
(add-to-list 'load-path "~/.emacs.d/custom/xelb")
|
||||
(require 'exwm)
|
||||
(require 'exwm-systemtray)
|
||||
(require 'exwm-config)
|
||||
(exwm-config-default)
|
||||
;(setq exwm-input-line-mode-passthrough t)
|
||||
#+END_SRC
|
||||
** Set focus fix
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defun exwm-input--set-focus (id)
|
||||
"Set input focus to window ID in a proper way."
|
||||
(when (exwm--id->buffer id)
|
||||
(with-current-buffer (exwm--id->buffer id)
|
||||
(cond
|
||||
((and (not exwm--hints-input)
|
||||
(memq xcb:Atom:WM_TAKE_FOCUS exwm--protocols))
|
||||
(when (= (frame-parameter nil 'exwm-id)
|
||||
(slot-value (xcb:+request-unchecked+reply exwm--connection
|
||||
(make-instance 'xcb:GetInputFocus))
|
||||
'focus))
|
||||
(exwm--log "Focus on #x%x with WM_TAKE_FOCUS" id)
|
||||
(exwm-input--update-timestamp
|
||||
(lambda (timestamp id)
|
||||
(let ((event (make-instance 'xcb:icccm:WM_TAKE_FOCUS
|
||||
:window id
|
||||
:time timestamp)))
|
||||
(setq event (xcb:marshal event exwm--connection))
|
||||
(xcb:+request exwm--connection
|
||||
(make-instance 'xcb:icccm:SendEvent
|
||||
:destination id
|
||||
:event event))
|
||||
(exwm-input--set-active-window id)
|
||||
(xcb:flush exwm--connection)))
|
||||
id)))
|
||||
(t
|
||||
(exwm--log "Focus on #x%x with SetInputFocus" id)
|
||||
(exwm-input--update-timestamp
|
||||
(lambda (timestamp id)
|
||||
(let ((event (make-instance 'xcb:icccm:WM_TAKE_FOCUS
|
||||
:window id
|
||||
:time timestamp)))
|
||||
(setq event (xcb:marshal event exwm--connection))
|
||||
(xcb:+request exwm--connection
|
||||
(make-instance 'xcb:icccm:SendEvent
|
||||
:destination id
|
||||
:event event)))
|
||||
(xcb:+request exwm--connection
|
||||
(make-instance 'xcb:SetInputFocus
|
||||
:revert-to xcb:InputFocus:Parent
|
||||
:focus id
|
||||
:time timestamp))
|
||||
(exwm-input--set-active-window id)
|
||||
(xcb:flush exwm--connection))
|
||||
id))))))
|
||||
#+END_SRC
|
||||
** Global keys
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(setq exwm-input-global-keys
|
||||
`(([?\s-r] . exwm-reset)
|
||||
([?\s-w] . exwm-workspace-switch)
|
||||
([?\s-l] . lock-screen)
|
||||
,@(mapcar (lambda (i)
|
||||
`(,(kbd (format "s-%d" (mod (1+ i) 10))) .
|
||||
(lambda ()
|
||||
(interactive)
|
||||
(exwm-workspace-switch-create ,i))))
|
||||
(number-sequence 0 9))
|
||||
(,(kbd "s-b") . ivy-switch-buffer)
|
||||
(,(kbd "s-a") . org-agenda)
|
||||
(,(kbd "s-c") . org-capture)
|
||||
(,(kbd "s-h") . split-window-right)
|
||||
(,(kbd "s-t") . split-window-below)
|
||||
(,(kbd "s-n") . switch-window)
|
||||
(,(kbd "s-k") . ido-kill-buffer)
|
||||
(,(kbd "s-s") . resize-window)))
|
||||
(global-set-key (kbd "M-T") 'flop-frame)
|
||||
(global-set-key (kbd "C-x p") 'launch-program)
|
||||
(global-set-key (kbd "M-…") 'multi-term)
|
||||
(global-set-key (kbd "C-ü") 'undo-tree-undo)
|
||||
(use-package transpose-frame)
|
||||
(setq exwm-input-global-keys
|
||||
`(([?\s-r] . exwm-reset)
|
||||
([?\s-w] . exwm-workspace-switch)
|
||||
([?\s-l] . lock-screen)
|
||||
,@(mapcar (lambda (i)
|
||||
`(,(kbd (format "s-%d" (mod (1+ i) 10))) .
|
||||
(lambda ()
|
||||
(interactive)
|
||||
(exwm-workspace-switch-create ,i))))
|
||||
(number-sequence 0 9))
|
||||
(,(kbd "s-b") . ivy-switch-buffer)
|
||||
(,(kbd "s-a") . org-agenda)
|
||||
(,(kbd "s-c") . org-capture)
|
||||
(,(kbd "s-h") . split-window-right)
|
||||
(,(kbd "s-t") . split-window-below)
|
||||
(,(kbd "s-n") . switch-window)
|
||||
(,(kbd "s-k") . ido-kill-buffer)
|
||||
(,(kbd "s-s") . resize-window)))
|
||||
(global-set-key (kbd "M-T") 'flop-frame)
|
||||
(global-set-key (kbd "C-x p") 'launch-program)
|
||||
(global-set-key (kbd "M-…") 'multi-term)
|
||||
(global-set-key (kbd "C-ü") 'undo-tree-undo)
|
||||
|
||||
(defun prompt-workspace (&optional prompt)
|
||||
"Prompt for a workspace, returning the workspace frame."
|
||||
(exwm-workspace--update-switch-history)
|
||||
(let* ((current-idx (exwm-workspace--position exwm-workspace--current))
|
||||
(history-add-new-input nil) ;prevent modifying history
|
||||
(history-idx (read-from-minibuffer
|
||||
(or prompt "Workspace: ")
|
||||
(elt exwm-workspace--switch-history current-idx)
|
||||
exwm-workspace--switch-map nil
|
||||
`(exwm-workspace--switch-history . ,(1+ current-idx))))
|
||||
(workspace-idx (mod (1- (cl-position history-idx exwm-workspace--switch-history
|
||||
:test #'equal)) 10)))
|
||||
(elt exwm-workspace--list workspace-idx)))
|
||||
(defun prompt-workspace (&optional prompt)
|
||||
"Prompt for a workspace, returning the workspace frame."
|
||||
(exwm-workspace--update-switch-history)
|
||||
(let* ((current-idx (exwm-workspace--position exwm-workspace--current))
|
||||
(history-add-new-input nil) ;prevent modifying history
|
||||
(history-idx (read-from-minibuffer
|
||||
(or prompt "Workspace: ")
|
||||
(elt exwm-workspace--switch-history current-idx)
|
||||
exwm-workspace--switch-map nil
|
||||
`(exwm-workspace--switch-history . ,(1+ current-idx))))
|
||||
(workspace-idx (mod (1- (cl-position history-idx exwm-workspace--switch-history
|
||||
:test #'equal))
|
||||
10)))
|
||||
(elt exwm-workspace--list workspace-idx)))
|
||||
|
||||
(advice-add 'exwm-workspace--prompt-for-workspace
|
||||
:override
|
||||
#'prompt-workspace)
|
||||
(advice-add 'exwm-workspace--prompt-for-workspace
|
||||
:override
|
||||
#'prompt-workspace)
|
||||
|
||||
#+END_SRC
|
||||
** Custom
|
||||
|
|
|
|||
1
custom/exwm
Submodule
1
custom/exwm
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 0680be104f9394e39dd55b5c4e33b9b7e4e77926
|
||||
1
custom/xelb
Submodule
1
custom/xelb
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 4509a3304ebfdb64a41be3ad2dc239c70227112e
|
||||
Loading…
Reference in a new issue