From e506f77fbee348ca7b4624d7d26c805195611f28 Mon Sep 17 00:00:00 2001 From: Ravi R Kiran Date: Tue, 16 Nov 2021 21:54:34 -0600 Subject: Convenience function for remote browsing diff --git a/lisp/kitty-remote-control.el b/lisp/kitty-remote-control.el index 6fe7d31..48fb3a3 100644 --- a/lisp/kitty-remote-control.el +++ b/lisp/kitty-remote-control.el @@ -84,6 +84,19 @@ `(("type" . "background") ("args" . ,cmd)))) +;; Common commands +(defvar kitty-rc-browser '("firefox") + "Browser arguments for kitty-rc-browse-url") +(defun kitty-rc-browse-url (url &rest args) + "Browse URL by launching browser remotely" + (kitty-rc-posted-command + (apply #'vector (append kitty-rc-browser + (list (browse-url-encode-url url)) + args)))) +(defun kitty-rc-browse-urls-remotely () + (interactive) + (setq browse-url-browser-function #'kitty-rc-browse-url)) + ;; Clipboard handling: could be generalized (defvar kitty-rc-clipboard-max-length 10000 "Maximum length of characters copied to clipboard") -- cgit v0.10.1