summaryrefslogtreecommitdiff
path: root/.stumpwm.d/commands.lisp
diff options
context:
space:
mode:
Diffstat (limited to '.stumpwm.d/commands.lisp')
-rw-r--r--.stumpwm.d/commands.lisp31
1 files changed, 13 insertions, 18 deletions
diff --git a/.stumpwm.d/commands.lisp b/.stumpwm.d/commands.lisp
index da88a18..e5c25b8 100644
--- a/.stumpwm.d/commands.lisp
+++ b/.stumpwm.d/commands.lisp
@@ -25,6 +25,19 @@
(make-web-jump "searxng" "nyxt https://search.thanosapollo.com/?q=")
(make-web-jump "Invidious" "firefox https://yewtu.be/search?q=")
+(defmacro defnyxt-search (name search-url command)
+ `(stumpwm:defcommand ,(intern (concatenate 'string "nyxt-" name)) (query)
+ ((:string "Search: "))
+ (stumpwm:run-shell-command
+ (concatenate 'string "nyxt -r -e '(" ,command "\"" ,search-url query "\"" ")'"))))
+
+(defvar thanos-searxng "https://search.thanosapollo.com/?q=")
+
+(defnyxt-search "searxng" thanos-searxng "buffer-load")
+(defnyxt-search "searxng-newb" thanos-searxng "set-url-new-buffer :url")
+(defnyxt-search "http" "http://" "buffer-load")
+
+;; Sly setup
(ql:quickload :slynk)
(defcommand sly-start-server () ()
@@ -35,24 +48,6 @@
"Stop current slynk server for sly."
(sb-thread:make-thread (lambda () (slynk:stop-server 4005))))
-(defcommand nyxt-buffer-search (search)
- ((:string "Search for: "))
- (let ((url "https://search.thanosapollo.com/?q="))
- (run-shell-command
- (concatenate 'string "nyxt -r -e '(buffer-load" "\"" url search "\"" ")'" ))))
-
-(stumpwm:defcommand nyxt-buffer-url (search)
- ((:string "Set URL: "))
- (let ((url "https://search.thanosapollo.com/?q="))
- (stumpwm:run-shell-command
- (concatenate 'string "nyxt -r -e '(buffer-load" "\"" search "\"" ")'" ))))
-
-(defcommand nyxt-new-buffer-search (search)
- ((:string "New Buffer Search for: "))
- (let ((url "https://search.thanosapollo.com/?q="))
- (run-shell-command
- (concatenate 'string "nyxt -r -e '(set-url-new-buffer :url" "\"" url search "\"" ")'" ))))
-
(defcommand firefox () ()
"Run or raise Firefox."