summaryrefslogtreecommitdiff
path: root/.stumpwm.d
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-09-26 15:17:57 +0300
committerThanos Apollo <[email protected]>2023-09-26 15:17:57 +0300
commit63c5750fb8cbeb10af0515c7facd6494720f2c0d (patch)
tree3ab0001482d815a17bff2c063a0229967a882e19 /.stumpwm.d
parent7cc3678673eb0b9017f99c7612a2a38e1e3b438d (diff)
[stumpwm] Add nyxt commands
Diffstat (limited to '.stumpwm.d')
-rw-r--r--.stumpwm.d/commands.lisp34
-rw-r--r--.stumpwm.d/keybindings.lisp9
-rw-r--r--.stumpwm.d/utils.lisp10
3 files changed, 35 insertions, 18 deletions
diff --git a/.stumpwm.d/commands.lisp b/.stumpwm.d/commands.lisp
index 888f223..516938c 100644
--- a/.stumpwm.d/commands.lisp
+++ b/.stumpwm.d/commands.lisp
@@ -4,7 +4,7 @@
"Set wallpaper using feh"
(let ((wallpaper-dir "~/wallpapers/"))
(format t "Setting wallpaper: ~a~%" wallpaper-name)
- (stumpwm:run-shell-command (format nil "feh --bg-scale ~a~a" wallpaper-dir wallpaper-name))))
+ (run-shell-command (format nil "feh --bg-scale ~a~a" wallpaper-dir wallpaper-name))))
(defun thanos/set-wallpapers ()
@@ -14,13 +14,39 @@
;; Web jump (works for DuckDuckGo)
(defmacro make-web-jump (name prefix)
- `(defcommand ,(intern name) (search) ((:rest ,(concatenate 'string "Ask the " name ": ")))
+ `(defcommand ,(intern name) (search) ((:rest ,(concatenate 'string "Search with " name ": ")))
(nsubstitute #\+ #\Space search)
(run-shell-command (concatenate 'string ,prefix search))))
-(make-web-jump "Duck" "firefox https://duckduckgo.com/?q=")
+;; (defcommand nyxt () (search) ((:rest ,(concatenate 'string "Search with " name ": ")))
+;; (nsubstitute #\+ #\Space search)
+;; (run-shell-command (concatenate 'string "nyxt -r -e" "" search)))
+
+(make-web-jump "searxng" "nyxt https://search.thanosapollo.com/?q=")
(make-web-jump "Invidious" "firefox https://yewtu.be/search?q=")
+(ql:quickload :slynk)
+
+(defcommand sly-start-server () ()
+ "Start a slynk server for sly."
+ (sb-thread:make-thread (lambda () (slynk:create-server :dont-close t))))
+
+(defcommand sly-stop-server () ()
+ "Stop current slynk server for sly."
+ (sb-thread:make-thread (lambda () (slynk:stop-server 4005))))
+
+(defcommand nyxt-buffer-load (search)
+ ((:string "Search for: "))
+ (let ((url "https://search.thanosapollo.com/?q="))
+ (run-shell-command
+ (concatenate 'string "nyxt -r -e '(buffer-load" "\"" url search "\"" ")'" ))))
+
+(defcommand nyxt-new-buffer-load (search)
+ ((:string "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."
(sb-thread:make-thread (lambda () (run-or-raise "firefox" '(:class "firefox") t nil))))
@@ -49,7 +75,7 @@
"kitty")))))
(when *initializing*
- (mapc #'stumpwm:run-shell-command
+ (mapc #'run-shell-command
'("picom"
"transmission-daemon"
"xsetroot -cursor_name left_ptr"))
diff --git a/.stumpwm.d/keybindings.lisp b/.stumpwm.d/keybindings.lisp
index a1224ee..7586047 100644
--- a/.stumpwm.d/keybindings.lisp
+++ b/.stumpwm.d/keybindings.lisp
@@ -51,7 +51,7 @@
(define-key *top-map* (kbd "F2") "exec brightnessctl --device='intel_backlight' set +5%")
(define-key *top-map* (kbd "F3") "exec ~/.scripts/keyboard-light-x220.sh")
- ;;; Groups
+;Groups
;; Switch to group
(define-key *root-map* (kbd "M-1") "gselect 1")
(define-key *root-map* (kbd "M-2") "gselect 2")
@@ -75,8 +75,9 @@
(define-key *root-map* (kbd "M-b") "move-window left")
(define-key *root-map* (kbd "M-f") "move-window right")
(define-key *root-map* (kbd "M-n") "move-window down")
-
-(define-key *root-map* (kbd "s") "Duck")
-
+;; Nyxt
+(define-key *root-map* (kbd "s") "nyxt-buffer-load")
+(define-key *root-map* (kbd "C-s") "nyxt-new-buffer-load")
+;; Productivity
(load-module "productivity")
(define-key *top-map* (kbd "F7") "productivity-mode-toggle")
diff --git a/.stumpwm.d/utils.lisp b/.stumpwm.d/utils.lisp
index 236f6f2..5739e7b 100644
--- a/.stumpwm.d/utils.lisp
+++ b/.stumpwm.d/utils.lisp
@@ -19,16 +19,6 @@
(stumpwm:load-module "globalwindows")
(stumpwm:load-module "urgentwindows")
-(ql:quickload :slynk)
-
-(stumpwm:defcommand sly-start-server () ()
- "Start a slynk server for sly."
- (sb-thread:make-thread (lambda () (slynk:create-server :dont-close t))))
-
-(stumpwm:defcommand sly-stop-server () ()
- "Stop current slynk server for sly."
- (sb-thread:make-thread (lambda () (slynk:stop-server 4005))))
-
(mpd:mpd-connect)
(setf kbd-layouts:*caps-lock-behavior* :swapped)