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
|
||||
#+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
|
||||
(after! emacs-everywhere
|
||||
;; Shell commands for interacting with window system
|
||||
(setq emacs-everywhere-paste-command
|
||||
'("wtype" "-M" "shift" "-P" "Insert")
|
||||
emacs-everywhere-copy-command
|
||||
'("sh" "-c" "wl-copy < %f")
|
||||
emacs-everywhere-window-focus-command
|
||||
'("hyprctl" "dispatch" "focuswindow" "address:%w"))
|
||||
(push '((wayland . Hyprland)
|
||||
:focus-command ("hyprctl" "dispatch" "focuswindow" "address:%w")
|
||||
:info-function emacs-everywhere--app-info-linux-hyprland)
|
||||
emacs-everywhere-system-configs)
|
||||
|
||||
;; Function for accessing current window
|
||||
(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*
|
||||
((`(,window-id ,window-class ,window-title . ,window-dims-)
|
||||
(split-string (shell-command-to-string
|
||||
"hyprctl activewindow -j | jaq -r \
|
||||
"hyprctl activewindow -j | jq -r \
|
||||
'.address, .class, .title, .at[], .size[]'")
|
||||
"\n"))
|
||||
(window-dims (mapcar #'string-to-number (butlast window-dims-))))
|
||||
"[\n\r]+" t))
|
||||
(window-dims (mapcar #'string-to-number window-dims-)))
|
||||
(make-emacs-everywhere-app
|
||||
:id window-id
|
||||
:class window-class
|
||||
:title window-title
|
||||
: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
|
||||
|
||||
** Mail
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue