-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using polybar with EXWM causes Corfu to popup incorrectly. #31
Comments
Off topic, but my recommendation for a status bar is to use the Emacs tab-bar. This is the best solution since you can also tweak it in Elisp. ;) |
Regarding Corfu, I suspect that the problem is similar to the problem of multi monitor setups, where we should take the position of the parent frame on the correct monitor into account. Without EXWM this is not a problem, since we do not unparent the Corfu child frame and as such stay always relative to the Emacs parent frame. See minad/corfu#408. |
Yes actually! So what I had to do was add the (defun get-focused-monitor-geometry ()
"Get the geometry of the monitor displaying the selected frame in EXWM."
(let* ((monitor-attrs (frame-monitor-attributes))
(workarea (assoc 'workarea monitor-attrs))
(geometry (cdr workarea)))
(list (nth 0 geometry) ; X
(nth 1 geometry) ; Y
(nth 2 geometry) ; Width
(nth 3 geometry) ; Height
)))
(defun advise-corfu-make-frame-with-monitor-awareness (orig-fun frame x y width height buffer)
"Advise `corfu--make-frame` to be monitor-aware, adjusting X and Y according to the focused monitor."
;; Get the geometry of the currently focused monitor
(let* ((monitor-geometry (get-focused-monitor-geometry))
(monitor-x (nth 0 monitor-geometry))
(monitor-y (nth 1 monitor-geometry))
(selected-frame-position (frame-position))
(selected-frame-x (car selected-frame-position))
(selected-frame-y (cdr selected-frame-position))
(new-x (+ monitor-x selected-frame-x x))
(new-y (+ monitor-y selected-frame-y y)))
;; Call the original function with potentially adjusted coordinates
(funcall orig-fun frame new-x new-y width height buffer)))
(advice-add 'corfu--make-frame :around #'advise-corfu-make-frame-with-monitor-awareness) Also, regarding the tab-bar, I PR'd some documentation for using i3bar.el with EXWM, Stebalien/i3bar.el#10, but in my opinion it's possible to do better with a standalone polybar-like package for using the tab-bar as a status bar. Polybar seems good enough for me right now though, and already has a segment for controlling MPD. |
Oh, interesting! I wasn't aware of @Stebalien's i3bar. What I am doing is different. I have all the status elements implemented in Elisp (or most of the ones also supported by i3bar). That's maybe not as efficient but nicely extensible. Also my music player is in Elisp, so I don't miss music player integration. But even with mpd, it is easy enough to access directly from Emacs. There exist at least ten Emacs mpd clients. ;) |
What do you use for music? I mostly use a combination of EMMS and MPD. I have a transient for jumping to some of my music directories (https://github.com/lemonbreezes/cae-emacs/blob/master/modules/cae/misc-applications/autoload/emms.el#L21) and I wrote a trivial command to jump to a random line in the current buffer (https://github.com/lemonbreezes/cae-emacs/blob/master/autoload/cae-editor.el#L432). So I jump to a music directory, jump to a random line, and play what I land on mostly. I also set up a few Dired keybindings for my music directory in a |
Just a small custom thingy based on mpv. It can play directly in Dired or other buffers (whatever format) via an Embark-style target finder. It basically turns arbitrary buffers into playlists. |
Today I have been testing various status bar solutions for EXWM and have noticed that while using polybar, the Corfu popup covers the text I am typing:
The text was updated successfully, but these errors were encountered: