compat(emacs-everywhere): use new system config API
This commit is contained in:
parent
8f325d53eb
commit
4402f8245f
1 changed files with 8 additions and 23 deletions
31
config.org
31
config.org
|
|
@ -2689,17 +2689,14 @@ The calendar's main purpose for me is to give a better view of the [[*Agenda][Or
|
||||||
:app everywhere
|
:app everywhere
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Emacs Everywhere is a great idea. Unfortunately, the default package on MELPA uses X-based window commands, while I use Hyprland, which is Wayland-based. To fix this issue, we need to override some of the package's variables and functions.
|
Emacs Everywhere is a great idea. Since I use Hyprland, which isn't supported by the package by default, we have to add the correct system config to its list.
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(after! emacs-everywhere
|
(after! emacs-everywhere
|
||||||
;; Shell commands for interacting with window system
|
(push '((wayland . Hyprland)
|
||||||
(setq emacs-everywhere-paste-command
|
:focus-command ("hyprctl" "dispatch" "focuswindow" "address:%w")
|
||||||
'("wtype" "-M" "shift" "-P" "Insert")
|
:info-function emacs-everywhere--app-info-linux-hyprland)
|
||||||
emacs-everywhere-copy-command
|
emacs-everywhere-system-configs)
|
||||||
'("sh" "-c" "wl-copy < %f")
|
|
||||||
emacs-everywhere-window-focus-command
|
|
||||||
'("hyprctl" "dispatch" "focuswindow" "address:%w"))
|
|
||||||
|
|
||||||
;; Function for accessing current window
|
;; Function for accessing current window
|
||||||
(defun emacs-everywhere--app-info-linux-hyprland ()
|
(defun emacs-everywhere--app-info-linux-hyprland ()
|
||||||
|
|
@ -2707,27 +2704,15 @@ Emacs Everywhere is a great idea. Unfortunately, the default package on MELPA us
|
||||||
(pcase-let*
|
(pcase-let*
|
||||||
((`(,window-id ,window-class ,window-title . ,window-dims-)
|
((`(,window-id ,window-class ,window-title . ,window-dims-)
|
||||||
(split-string (shell-command-to-string
|
(split-string (shell-command-to-string
|
||||||
"hyprctl activewindow -j | jaq -r \
|
"hyprctl activewindow -j | jq -r \
|
||||||
'.address, .class, .title, .at[], .size[]'")
|
'.address, .class, .title, .at[], .size[]'")
|
||||||
"\n"))
|
"[\n\r]+" t))
|
||||||
(window-dims (mapcar #'string-to-number (butlast window-dims-))))
|
(window-dims (mapcar #'string-to-number window-dims-)))
|
||||||
(make-emacs-everywhere-app
|
(make-emacs-everywhere-app
|
||||||
:id window-id
|
:id window-id
|
||||||
:class window-class
|
:class window-class
|
||||||
:title window-title
|
:title window-title
|
||||||
:geometry window-dims))))
|
:geometry window-dims))))
|
||||||
|
|
||||||
(defpatch! emacs-everywhere
|
|
||||||
(defun emacs-everywhere--app-info-linux) ()
|
|
||||||
"Return information on the active window, on Linux."
|
|
||||||
(pcase emacs-everywhere--display-server
|
|
||||||
(`(x11 . ,_) (emacs-everywhere--app-info-linux-x11))
|
|
||||||
(`(wayland . KDE) (emacs-everywhere--app-info-linux-kde))
|
|
||||||
(`(wayland . sway) (emacs-everywhere--app-info-linux-sway))
|
|
||||||
(el-patch-add
|
|
||||||
(`(wayland . Hyprland) (emacs-everywhere--app-info-linux-hyprland)))
|
|
||||||
(_ (user-error "Unable to fetch app info with display server %S"
|
|
||||||
emacs-everywhere--display-server))))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Mail
|
** Mail
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue