summaryrefslogtreecommitdiff
path: root/.config/emacs/bd-default.el
diff options
context:
space:
mode:
Diffstat (limited to '.config/emacs/bd-default.el')
-rw-r--r--.config/emacs/bd-default.el30
1 files changed, 23 insertions, 7 deletions
diff --git a/.config/emacs/bd-default.el b/.config/emacs/bd-default.el
index e7c70d8..39cd231 100644
--- a/.config/emacs/bd-default.el
+++ b/.config/emacs/bd-default.el
@@ -32,16 +32,21 @@
(concat "/sudo:root@localhost:"
buffer-file-name))))
-(defun rip-video ()
+(defun rip-video (url &rest _)
+ "Given a url, rip and play the video
+with yt-dlp and mpv."
+ (message "Ludu %s" url)
+ (start-process-shell-command "rip-video" nil (concat "rip-video " url)))
+
+(defun parse-and-rip-video ()
"If region, open SEARCH with mpv in --full-screen. Else,
-open URL at point."
+ open URL at point."
(interactive)
(let ((URL-OR-SEARCH
(if (use-region-p)
(buffer-substring (mark) (point))
(shr-url-at-point nil))))
- (message "Ludu %s" URL-OR-SEARCH)
- (start-process-shell-command "rip-video" nil (concat "rip-video " URL-OR-SEARCH))))
+ (rip-video URL)))
;;;; defaults
@@ -107,7 +112,7 @@ open URL at point."
:demand t
:bind (("C-z C-n" . newsticker-show-news)
:map newsticker-treeview-item-mode-map
- ("C-j" . rip-video))
+ ("C-j" . parse-and-rip-video))
:custom
(newsticker-url-list-defaults nil)
(newsticker-automatically-mark-items-as-old nil)
@@ -130,7 +135,17 @@ open URL at point."
(use-package eww
:demand t
:custom
- (eww-auto-rename-buffer 'title))
+ ;; default to eww
+ (browse-url-browser-function 'eww-browse-url)
+ (shr-use-fonts nil)
+ (shr-cookie-policy nil)
+ (shr-max-width 85)
+ (url-privacy-level '(email os emacs lastloc cookies))
+ (eww-search-prefix "https://searx.be/search?q=")
+ (eww-auto-rename-buffer 'title)
+ (eww-use-browse-url (regexp-opt '("mailto:" "youtube.com" "youtu.be" "yewtu.be")))
+ (browse-url-handlers
+ `((,(regexp-opt '("youtube.com" "youtu.be" "yewtu.be")) . rip-video))))
(use-package image-dired
:bind (("C-c d" . dired-jump))
@@ -138,7 +153,8 @@ open URL at point."
(dired-listing-switches "-alh")
(dired-guess-shell-alist-user
`((,(regexp-opt '(".mkv" ".mov" ".mp4" ".webm" ".m4v" ".wav" ".mp3" ".opus" ".ogv" ".flac")) "mpv &")
- (,(regexp-opt '(".pdf")) "zathura &"))))
+ (,(regexp-opt '(".pdf")) "zathura &")
+ (,(regexp-opt '(".html")) "icecat &"))))
(use-package erc
:config