summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/kitty-remote-control.el13
1 files changed, 13 insertions, 0 deletions
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")