diff options
| author | jao <jao@gnu.org> | 2026-10-16 23:14:21 +0100 |
|---|---|---|
| committer | jao <jao@gnu.org> | 2026-10-16 23:14:21 +0100 |
| commit | 1c41c7cbdb1e62c9c3976bda5bba11ec7e3143a1 (patch) | |
| tree | 75071154f7e2b222e0af375c36304b47ef854425 | |
| parent | 93a16f486d0420767be66e71901a1afafd907922 (diff) | |
| download | elibs-1c41c7cbdb1e62c9c3976bda5bba11ec7e3143a1.tar.gz elibs-1c41c7cbdb1e62c9c3976bda5bba11ec7e3143a1.tar.bz2 | |
exwm: firefox support
| -rw-r--r-- | custom/jao-custom-exwm.el | 26 | ||||
| -rw-r--r-- | lib/wm/jao-exwm.el | 31 |
2 files changed, 30 insertions, 27 deletions
diff --git a/custom/jao-custom-exwm.el b/custom/jao-custom-exwm.el index 09a5180..d36c8f1 100644 --- a/custom/jao-custom-exwm.el +++ b/custom/jao-custom-exwm.el @@ -59,34 +59,8 @@ (start-process-shell-command "import" "* exwm - console *" c))) ;;; Firefox support -(jao-def-exwm-toggler jao-exwm-firefox -1 "firefox" "firefox") - -(defun jao-exwm-browse-with-firefox (&rest args) - (jao-exwm-firefox) - (apply #'browse-url-firefox args)) - (setq browse-url-secondary-browser-function #'jao-exwm-browse-with-firefox) -(defun jao-exwm-kill-firefox-url () - (interactive) - (when-let* ((b (jao-exwm-find-class-buffer "firefox"))) - (let ((cb (current-buffer))) - (switch-to-buffer b) - (exwm-input--fake-key ?y) - (exwm-input--fake-key ?y) - (prog1 (current-kill 1) - (switch-to-buffer cb))))) - -(defun jao-exwm-firefox-search (query) - (interactive "sQuery: ") - (jao-exwm-firefox) - (sit-for 0.5) - (exwm-input--fake-key ?s) - (dolist (k (string-to-list query)) - (exwm-input--fake-key k)) - (sit-for 0.5) - (exwm-input--fake-key ?\r)) - ;;; Transients (jao-transient-major-mode+ doc-view ["External viewers" diff --git a/lib/wm/jao-exwm.el b/lib/wm/jao-exwm.el index 52a2e34..7027df4 100644 --- a/lib/wm/jao-exwm.el +++ b/lib/wm/jao-exwm.el @@ -17,7 +17,11 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see <https://www.gnu.org/licenses/>. +;;; Deps +(require 'browse-url) +(require 'exwm) (require 'jao-minibuffer) +(require 'jao-afio) ;;; Helpers (defvar jao-exwm-use-afio t) @@ -33,7 +37,7 @@ (require 'exwm-systemtray) (exwm-systemtray-mode 1) -(defun jao-exwm--watch-tray (sym newval op where) +(defun jao-exwm--watch-tray (_sym newval _op _where) (setq jao-minibuffer-right-margin (/ newval (string-pixel-width "a"))) (jao-minibuffer-refresh)) @@ -193,7 +197,32 @@ (jao-afio-toggle) (,name)))))) +;;; Firefox support +(jao-def-exwm-toggler jao-exwm-firefox -1 "firefox" "firefox") +(defun jao-exwm-browse-with-firefox (&rest args) + (jao-exwm-firefox) + (apply #'browse-url-firefox args)) + +(defun jao-exwm-kill-firefox-url () + (interactive) + (when-let* ((b (jao-exwm-find-class-buffer "firefox"))) + (let ((cb (current-buffer))) + (switch-to-buffer b) + (exwm-input--fake-key ?y) + (exwm-input--fake-key ?y) + (prog1 (current-kill 1) + (switch-to-buffer cb))))) + +(defun jao-exwm-firefox-search (query) + (interactive "sQuery: ") + (jao-exwm-firefox) + (sit-for 0.5) + (exwm-input--fake-key ?s) + (dolist (k (string-to-list query)) + (exwm-input--fake-key k)) + (sit-for 0.5) + (exwm-input--fake-key ?\r)) (provide 'jao-exwm) ;;; jao-exwm.el ends here |
