summaryrefslogtreecommitdiff
path: root/.config/nyxt/hsplit.lisp
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-09-27 02:10:25 +0300
committerThanos Apollo <[email protected]>2023-09-27 02:10:25 +0300
commit47b73144d1b30514df003560851de3bd06e88b81 (patch)
tree27b0b2e914c6867d90f6ce456b123606803a8a09 /.config/nyxt/hsplit.lisp
parent696a16039e28e5844a164d69f60006b9c11a0067 (diff)
[New] Add nyxt, slightly modified config from aartaka
Diffstat (limited to '.config/nyxt/hsplit.lisp')
-rw-r--r--.config/nyxt/hsplit.lisp25
1 files changed, 25 insertions, 0 deletions
diff --git a/.config/nyxt/hsplit.lisp b/.config/nyxt/hsplit.lisp
new file mode 100644
index 0000000..2f49510
--- /dev/null
+++ b/.config/nyxt/hsplit.lisp
@@ -0,0 +1,25 @@
+(in-package #:nyxt-user)
+
+(define-panel-command hsplit-internal (&key (url (quri:render-uri (url (current-buffer)))))
+ (panel "*Duplicate panel*" :right)
+ "Duplicate the current buffer URL in the panel buffer on the right.
+
+A poor man's hsplit :)"
+ (setf (ffi-width panel) 550)
+ (run-thread "URL loader"
+ (sleep 0.3)
+ (buffer-load (quri:uri url) :buffer panel))
+ "")
+
+(define-command-global close-all-panels ()
+ "Close all the panel buffers there are."
+ (alexandria:when-let ((panels (nyxt/renderer/gtk::panel-buffers-right (current-window))))
+ (delete-panel-buffer :window (current-window) :panels panels))
+ (alexandria:when-let ((panels (nyxt/renderer/gtk::panel-buffers-left (current-window))))
+ (delete-panel-buffer :window (current-window) :panels panels)))
+
+(define-command-global hsplit ()
+ "Based on `hsplit-internal' above."
+ (if (nyxt/renderer/gtk::panel-buffers-right (current-window))
+ (delete-all-panel-buffers (current-window))
+ (hsplit-internal)))