mirror of
https://github.com/SqrtMinusOne/dotfiles.git
synced 2025-12-11 19:45:25 +03:00
fix(exwm): troubles with posframe
This commit is contained in:
parent
f22856746a
commit
6402061319
2 changed files with 39 additions and 32 deletions
|
|
@ -288,13 +288,17 @@ DIR is either 'left or 'right."
|
||||||
focus-follows-mouse)))
|
focus-follows-mouse)))
|
||||||
|
|
||||||
(defun my/restore-posframe (&rest args)
|
(defun my/restore-posframe (&rest args)
|
||||||
(mapc
|
(run-with-timer
|
||||||
(lambda (var)
|
0.25
|
||||||
(kill-local-variable var)
|
nil
|
||||||
(setf (symbol-value var) t))
|
(lambda ()
|
||||||
'(exwm-workspace-warp-cursor
|
(mapc
|
||||||
mouse-autoselect-window
|
(lambda (var)
|
||||||
focus-follows-mouse)))
|
(kill-local-variable var)
|
||||||
|
(setf (symbol-value var) t))
|
||||||
|
'(exwm-workspace-warp-cursor
|
||||||
|
mouse-autoselect-window
|
||||||
|
focus-follows-mouse)))))
|
||||||
|
|
||||||
(advice-add #'posframe--create-posframe :after #'my/setup-posframe)
|
(advice-add #'posframe--create-posframe :after #'my/setup-posframe)
|
||||||
(advice-add #'ivy-posframe-cleanup :after #'my/restore-posframe)
|
(advice-add #'ivy-posframe-cleanup :after #'my/restore-posframe)
|
||||||
|
|
@ -402,7 +406,7 @@ _d_: Discord
|
||||||
(setq mouse-autoselect-window t)
|
(setq mouse-autoselect-window t)
|
||||||
(setq focus-follows-mouse t)
|
(setq focus-follows-mouse t)
|
||||||
|
|
||||||
|
|
||||||
(setq exwm-input-prefix-keys
|
(setq exwm-input-prefix-keys
|
||||||
`(?\C-x
|
`(?\C-x
|
||||||
?\C-w
|
?\C-w
|
||||||
|
|
@ -410,7 +414,7 @@ _d_: Discord
|
||||||
?\M-u))
|
?\M-u))
|
||||||
(defmacro my/app-command (command)
|
(defmacro my/app-command (command)
|
||||||
`(lambda () (interactive) (my/run-in-background ,command)))
|
`(lambda () (interactive) (my/run-in-background ,command)))
|
||||||
|
|
||||||
(general-define-key
|
(general-define-key
|
||||||
:keymaps '(exwm-mode-map)
|
:keymaps '(exwm-mode-map)
|
||||||
"C-q" #'exwm-input-send-next-key
|
"C-q" #'exwm-input-send-next-key
|
||||||
|
|
@ -425,46 +429,46 @@ _d_: Discord
|
||||||
`(
|
`(
|
||||||
;; Reset to line-mode
|
;; Reset to line-mode
|
||||||
(,(kbd "s-R") . exwm-reset)
|
(,(kbd "s-R") . exwm-reset)
|
||||||
|
|
||||||
;; Switch windows
|
;; Switch windows
|
||||||
(,(kbd "s-<left>") . (lambda () (interactive) (my/exwm-windmove 'left)))
|
(,(kbd "s-<left>") . (lambda () (interactive) (my/exwm-windmove 'left)))
|
||||||
(,(kbd "s-<right>") . (lambda () (interactive) (my/exwm-windmove 'right)))
|
(,(kbd "s-<right>") . (lambda () (interactive) (my/exwm-windmove 'right)))
|
||||||
(,(kbd "s-<up>") . (lambda () (interactive) (my/exwm-windmove 'up)))
|
(,(kbd "s-<up>") . (lambda () (interactive) (my/exwm-windmove 'up)))
|
||||||
(,(kbd "s-<down>") . (lambda () (interactive) (my/exwm-windmove 'down)))
|
(,(kbd "s-<down>") . (lambda () (interactive) (my/exwm-windmove 'down)))
|
||||||
|
|
||||||
(,(kbd "s-h"). (lambda () (interactive) (my/exwm-windmove 'left)))
|
(,(kbd "s-h"). (lambda () (interactive) (my/exwm-windmove 'left)))
|
||||||
(,(kbd "s-l") . (lambda () (interactive) (my/exwm-windmove 'right)))
|
(,(kbd "s-l") . (lambda () (interactive) (my/exwm-windmove 'right)))
|
||||||
(,(kbd "s-k") . (lambda () (interactive) (my/exwm-windmove 'up)))
|
(,(kbd "s-k") . (lambda () (interactive) (my/exwm-windmove 'up)))
|
||||||
(,(kbd "s-j") . (lambda () (interactive) (my/exwm-windmove 'down)))
|
(,(kbd "s-j") . (lambda () (interactive) (my/exwm-windmove 'down)))
|
||||||
|
|
||||||
;; Moving windows
|
;; Moving windows
|
||||||
(,(kbd "s-H") . (lambda () (interactive) (my/exwm-move-window 'left)))
|
(,(kbd "s-H") . (lambda () (interactive) (my/exwm-move-window 'left)))
|
||||||
(,(kbd "s-L") . (lambda () (interactive) (my/exwm-move-window 'right)))
|
(,(kbd "s-L") . (lambda () (interactive) (my/exwm-move-window 'right)))
|
||||||
(,(kbd "s-K") . (lambda () (interactive) (my/exwm-move-window 'up)))
|
(,(kbd "s-K") . (lambda () (interactive) (my/exwm-move-window 'up)))
|
||||||
(,(kbd "s-J") . (lambda () (interactive) (my/exwm-move-window 'down)))
|
(,(kbd "s-J") . (lambda () (interactive) (my/exwm-move-window 'down)))
|
||||||
|
|
||||||
;; Fullscreen
|
;; Fullscreen
|
||||||
(,(kbd "s-f") . exwm-layout-toggle-fullscreen)
|
(,(kbd "s-f") . exwm-layout-toggle-fullscreen)
|
||||||
(,(kbd "s-F") . exwm-floating-toggle-floating)
|
(,(kbd "s-F") . exwm-floating-toggle-floating)
|
||||||
|
|
||||||
;; Quit
|
;; Quit
|
||||||
(,(kbd "s-Q") . my/exwm-quit)
|
(,(kbd "s-Q") . my/exwm-quit)
|
||||||
|
|
||||||
;; Split windows
|
;; Split windows
|
||||||
(,(kbd "s-s") . evil-window-vsplit)
|
(,(kbd "s-s") . evil-window-vsplit)
|
||||||
(,(kbd "s-v") . evil-window-hsplit)
|
(,(kbd "s-v") . evil-window-hsplit)
|
||||||
|
|
||||||
;; Switch perspectives
|
;; Switch perspectives
|
||||||
(,(kbd "s-,") . persp-prev)
|
(,(kbd "s-,") . persp-prev)
|
||||||
(,(kbd "s-.") . persp-next)
|
(,(kbd "s-.") . persp-next)
|
||||||
|
|
||||||
;; Switch buffers
|
;; Switch buffers
|
||||||
(,(kbd "s-e") . persp-ivy-switch-buffer)
|
(,(kbd "s-e") . persp-ivy-switch-buffer)
|
||||||
(,(kbd "s-E") . my/persp-ivy-switch-buffer-other-window)
|
(,(kbd "s-E") . my/persp-ivy-switch-buffer-other-window)
|
||||||
|
|
||||||
;; Resize windows
|
;; Resize windows
|
||||||
(,(kbd "s-r") . my/exwm-resize-hydra/body)
|
(,(kbd "s-r") . my/exwm-resize-hydra/body)
|
||||||
|
|
||||||
;; Apps & stuff
|
;; Apps & stuff
|
||||||
(,(kbd "s-p") . counsel-linux-app)
|
(,(kbd "s-p") . counsel-linux-app)
|
||||||
(,(kbd "s-P") . async-shell-command)
|
(,(kbd "s-P") . async-shell-command)
|
||||||
|
|
@ -472,24 +476,24 @@ _d_: Discord
|
||||||
(,(kbd "s--") . password-store-ivy)
|
(,(kbd "s--") . password-store-ivy)
|
||||||
(,(kbd "s-=") . my/emojify-type)
|
(,(kbd "s-=") . my/emojify-type)
|
||||||
(,(kbd "s-i") . ,(my/app-command "copyq menu"))
|
(,(kbd "s-i") . ,(my/app-command "copyq menu"))
|
||||||
|
|
||||||
;; Basic controls
|
;; Basic controls
|
||||||
(,(kbd "<XF86AudioRaiseVolume>") . ,(my/app-command "ponymix increase 5 --max-volume 150"))
|
(,(kbd "<XF86AudioRaiseVolume>") . ,(my/app-command "ponymix increase 5 --max-volume 150"))
|
||||||
(,(kbd "<XF86AudioLowerVolume>") . ,(my/app-command "ponymix decrease 5 --max-volume 150"))
|
(,(kbd "<XF86AudioLowerVolume>") . ,(my/app-command "ponymix decrease 5 --max-volume 150"))
|
||||||
(,(kbd "<XF86MonBrightnessUp>") . ,(my/app-command "light -A 5"))
|
(,(kbd "<XF86MonBrightnessUp>") . ,(my/app-command "light -A 5"))
|
||||||
(,(kbd "<XF86MonBrightnessDown>") . ,(my/app-command "light -U 5"))
|
(,(kbd "<XF86MonBrightnessDown>") . ,(my/app-command "light -U 5"))
|
||||||
(,(kbd "<XF86AudioMute>") . ,(my/app-command "ponymix toggle"))
|
(,(kbd "<XF86AudioMute>") . ,(my/app-command "ponymix toggle"))
|
||||||
|
|
||||||
(,(kbd "<XF86AudioPlay>") . ,(my/app-command "mpc toggle"))
|
(,(kbd "<XF86AudioPlay>") . ,(my/app-command "mpc toggle"))
|
||||||
(,(kbd "<XF86AudioPause>") . ,(my/app-command "mpc pause"))
|
(,(kbd "<XF86AudioPause>") . ,(my/app-command "mpc pause"))
|
||||||
(,(kbd "<print>") . ,(my/app-command "flameshot gui"))
|
(,(kbd "<print>") . ,(my/app-command "flameshot gui"))
|
||||||
|
|
||||||
;; Switch workspace
|
;; Switch workspace
|
||||||
(,(kbd "s-q") . my/exwm-switch-to-other-monitor)
|
(,(kbd "s-q") . my/exwm-switch-to-other-monitor)
|
||||||
(,(kbd "s-w") . exwm-workspace-switch)
|
(,(kbd "s-w") . exwm-workspace-switch)
|
||||||
(,(kbd "s-W") . exwm-workspace-move-window)
|
(,(kbd "s-W") . exwm-workspace-move-window)
|
||||||
(,(kbd "s-<tab>") . my/exwm-workspace-switch-monitor)
|
(,(kbd "s-<tab>") . my/exwm-workspace-switch-monitor)
|
||||||
|
|
||||||
;; Perspectives
|
;; Perspectives
|
||||||
(,(kbd "s-[") . perspective-exwm-cycle-exwm-buffers-backward)
|
(,(kbd "s-[") . perspective-exwm-cycle-exwm-buffers-backward)
|
||||||
(,(kbd "s-]") . perspective-exwm-cycle-exwm-buffers-forward)
|
(,(kbd "s-]") . perspective-exwm-cycle-exwm-buffers-forward)
|
||||||
|
|
@ -497,7 +501,7 @@ _d_: Discord
|
||||||
(,(kbd "s-<mouse-5>") . perspective-exwm-cycle-exwm-buffers-forward)
|
(,(kbd "s-<mouse-5>") . perspective-exwm-cycle-exwm-buffers-forward)
|
||||||
(,(kbd "s-`") . perspective-exwm-switch-perspective)
|
(,(kbd "s-`") . perspective-exwm-switch-perspective)
|
||||||
(,(kbd "s-o") . ,(my/app-command "rofi -show window"))
|
(,(kbd "s-o") . ,(my/app-command "rofi -show window"))
|
||||||
|
|
||||||
;; 's-N': Switch to certain workspace with Super (Win) plus a number key (0 - 9)
|
;; 's-N': Switch to certain workspace with Super (Win) plus a number key (0 - 9)
|
||||||
,@(mapcar (lambda (i)
|
,@(mapcar (lambda (i)
|
||||||
`(,(kbd (format "s-%d" i)) .
|
`(,(kbd (format "s-%d" i)) .
|
||||||
|
|
@ -505,7 +509,7 @@ _d_: Discord
|
||||||
(interactive)
|
(interactive)
|
||||||
(exwm-workspace-switch-create ,i))))
|
(exwm-workspace-switch-create ,i))))
|
||||||
(number-sequence 0 9))))
|
(number-sequence 0 9))))
|
||||||
|
|
||||||
(defun exwm-input--fake-last-command ()
|
(defun exwm-input--fake-last-command ()
|
||||||
"Fool some packages into thinking there is a change in the buffer."
|
"Fool some packages into thinking there is a change in the buffer."
|
||||||
(setq last-command #'exwm-input--noop)
|
(setq last-command #'exwm-input--noop)
|
||||||
|
|
|
||||||
17
Desktop.org
17
Desktop.org
|
|
@ -792,13 +792,16 @@ Not sure about that. The cursor occasionally changes focus when I'm exiting posf
|
||||||
focus-follows-mouse)))
|
focus-follows-mouse)))
|
||||||
|
|
||||||
(defun my/restore-posframe (&rest args)
|
(defun my/restore-posframe (&rest args)
|
||||||
(mapc
|
(run-with-timer
|
||||||
(lambda (var)
|
0.25
|
||||||
(kill-local-variable var)
|
(lambda ()
|
||||||
(setf (symbol-value var) t))
|
(mapc
|
||||||
'(exwm-workspace-warp-cursor
|
(lambda (var)
|
||||||
mouse-autoselect-window
|
(kill-local-variable var)
|
||||||
focus-follows-mouse)))
|
(setf (symbol-value var) t))
|
||||||
|
'(exwm-workspace-warp-cursor
|
||||||
|
mouse-autoselect-window
|
||||||
|
focus-follows-mouse)))))
|
||||||
|
|
||||||
(advice-add #'posframe--create-posframe :after #'my/setup-posframe)
|
(advice-add #'posframe--create-posframe :after #'my/setup-posframe)
|
||||||
(advice-add #'ivy-posframe-cleanup :after #'my/restore-posframe)
|
(advice-add #'ivy-posframe-cleanup :after #'my/restore-posframe)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue