making rofi work a lil better

This commit is contained in:
Chris Cochrun 2021-09-27 17:13:21 -05:00
parent 9daaa96d74
commit 38e0f2f923
14 changed files with 156 additions and 79 deletions

View file

@ -21,11 +21,13 @@
((session-restore-prompt :always-restore)))
(define-configuration (prompt-buffer)
((default-modes (append '(vi-insert-mode
) %slot-default%))))
((default-modes
(append
'(vi-insert-mode)
%slot-default%))))
(define-configuration browser
((external-editor-program '("/usr/bin/emacsclient"))))
((external-editor-program '("/usr/bin/emacsclient"))))
;; Create a function to launch mpv with given url
(defun mpv (url)
@ -34,32 +36,37 @@
;; Create a function to download videos with youtube-dl in alacritty
(defun youtube-dl (url)
"Download videos and audio with youtube-dl in alacritty for feedback"
(uiop:run-program (list "alacritty" "-e" "youtube-dl" "-o ~/Videos/%(title)s.%(ext)s" url)))
"Download videos and audio with youtube-dl in alacritty for feedback"
(uiop:run-program
(list "alacritty" "-e" "youtube-dl" "-o ~/Videos/%(title)s.%(ext)s" url)))
;; Let's create a function to hint videos, convert the url to a sting, and play them in MPV
(define-command hint-mpv (&key nyxt/web-mode::annotate-visible-only-p)
"Show a set of element hints, and copy the URL of the user inputted one."
"Show a set of element hints, and copy the URL of the user inputted one."
(nyxt/web-mode:query-hints "Copy element URL"
(lambda (nyxt/web-mode::result)
;; this converts the url to a string to be used in mpv
(let* ((url (format nil "~a"
(url (first nyxt/web-mode::result)))))
;; here we take that string and pipe it into mpv
(mpv url)))
;; this converts the url to a string to be used in mpv
(let*
((url
(format nil "~a"
(url (first nyxt/web-mode::result)))))
;; here we take that string and pipe it into mpv
(mpv url)))
:annotate-visible-only-p
nyxt/web-mode::annotate-visible-only-p))
;; Let's create a function to hint videos, convert the url to a sting, and download with ytdl
(define-command hint-ytdl (&key nyxt/web-mode::annotate-visible-only-p)
"Show a set of element hints, and copy the URL of the user inputted one."
"Show a set of element hints, and copy the URL of the user inputted one."
(nyxt/web-mode:query-hints "Copy element URL"
(lambda (nyxt/web-mode::result)
;; this converts the url to a string to be used in mpv
(let* ((url (format nil "~a"
(url (first nyxt/web-mode::result)))))
;; here we take that string and pipe it into mpv
(youtube-dl url)))
;; this converts the url to a string to be used in mpv
(let*
((url
(format nil "~a"
(url (first nyxt/web-mode::result)))))
;; here we take that string and pipe it into mpv
(youtube-dl url)))
:annotate-visible-only-p
nyxt/web-mode::annotate-visible-only-p))
@ -79,17 +86,20 @@
(define-mode chris-mode ()
"Dummy mode for the custom key bindings in `*chris-keymap*'."
((keymap-scheme (keymap:make-scheme
scheme:vi-normal *chris-keymap*))
((keymap-scheme
(keymap:make-scheme
scheme:vi-normal *chris-keymap*))
(visible-in-status-p nil)))
(define-configuration buffer
((default-modes (append '(vi-normal-mode
auto-mode
reduce-tracking-mode
force-https-mode
chris-mode)
%slot-default%))))
((default-modes
(append
'(vi-normal-mode
auto-mode
reduce-tracking-mode
force-https-mode
chris-mode)
%slot-default%))))
(define-configuration buffer
((search-engines