diff options
author | jao <jao@gnu.org> | 2022-09-23 01:04:24 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-09-23 01:04:24 +0100 |
commit | 6e3513a1e72c3ecb2706129cccf1f32331c060b8 (patch) | |
tree | 8ab235ce6a23614ad713509d4c251519c34d511a /lib/eos | |
parent | 230ce7a7c0ed0001dfe1e590f99c7bbaa90b346c (diff) | |
download | elibs-6e3513a1e72c3ecb2706129cccf1f32331c060b8.tar.gz elibs-6e3513a1e72c3ecb2706129cccf1f32331c060b8.tar.bz2 |
river tweaks
Diffstat (limited to 'lib/eos')
-rw-r--r-- | lib/eos/jao-wayland.el | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/lib/eos/jao-wayland.el b/lib/eos/jao-wayland.el index 8068dd7..104bd23 100644 --- a/lib/eos/jao-wayland.el +++ b/lib/eos/jao-wayland.el @@ -51,10 +51,10 @@ (defun jao-river-focus-window (title &optional rx) (let* ((ws (jao-river-window-list)) - (fltr (if rx #'string-match-p #'string=) ) + (fltr (if rx #'string-match-p #'string=)) (w (seq-find (lambda (w) - (or (funcall fltr title (alist-get 'title w "")) - (funcall fltr title (alist-get 'app_id w "")))) + (or (funcall fltr title (alist-get 'app_id w "")) + (funcall fltr title (alist-get 'title w "")))) ws))) (or (alist-get 'activated w) (seq-some (lambda (_ignored) @@ -101,12 +101,20 @@ (jao-tracking-set-log "")) (defun jao-river-toggle-emacs () - (if (or (member (jao-river-get-focused-app-id) '("emacs" "pemacs")) - (member (jao-river-get-focused-title) '("emacsclient" "emacs"))) - (jao-shell-exec "riverctl focus-previous-tags") - (jao-river-to-ws 1) - (unless (jao-river-focus-window "^p?emacs\\(client\\)?" t) - (jao-shell-exec* "riverctl" "spawn" "efoot")))) + (let ((erx "^p?emacs\\(client\\)?")) + (if (or (string-match-p erx (jao-river-get-focused-title)) + (string-match-p erx (jao-river-get-focused-app-id))) + (jao-shell-exec "riverctl focus-previous-tags") + (jao-river-to-ws 1) + (unless (jao-river-focus-window erx t) + (jao-shell-exec* "riverctl" "spawn" "efoot"))))) + +(defun jao-river-toggle-firefox () + (if (string-match-p "Firefox" (or (jao-river-get-focused-app-id) "")) + (jao-river-to-ws 1) + (jao-river-to-ws 2) + (unless (jao-river-focus-window "Firefox") + (jao-shell-exec* "riverctl" "spawn" "firefox")))) ;;; sway (defun jao-sway-msg (msg) |