From ef40efc886be9738f314ea6b4b5bd0b07c649db3 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Tue, 28 May 2024 10:07:32 -0500 Subject: [PATCH] adding some tweaks to eww and empv --- README.org | 37 ++++++++++++++++++++++++------------- init.el | 34 +++++++++++++++++++++------------- 2 files changed, 45 insertions(+), 26 deletions(-) diff --git a/README.org b/README.org index ab43e389..56c91128 100644 --- a/README.org +++ b/README.org @@ -1116,37 +1116,39 @@ Part of this config includes some special capture templates for my work as a you (setq org-publish-project-alist `(("home" - :base-directory "~/docs/notes/site/" + :base-directory "~/docs/notes/site/content" :base-extension "org" :recursive nil :html-doctype "html5" :html-html5-fancy t :html-self-link-headlines t - :html-head "" - :publishing-directory "~/cochrun.xyz/" + :html-head "" + :publishing-directory "~/docs/notes/site/public/" :publishing-function org-html-publish-to-html) ("posts" - :base-directory "~/docs/notes/site/content/" + :base-directory "~/docs/notes/site/content/posts" :base-extension "org" :recursive t :html-doctype "html5" :html-html5-fancy t :html-self-link-headlines t :htmlized-source t - :html-head "" - :publishing-directory "~/cochrun.xyz/content/" + :html-head "" + :publishing-directory "~/docs/notes/site/public/content/" :publishing-function org-html-publish-to-html) ("static" :base-directory "~/docs/notes/site/assets/" :base-extension "css\\|txt\\|jpg\\|gif\\|png" - :exclude "bibles\\|.st.*\\|.templates" :recursive t :html-doctype "html5" :html-html5-fancy t - :html-head "" - :publishing-directory "~/cochrun.xyz/content/" + :publishing-directory "~/docs/notes/site/public/" :publishing-function org-publish-attachment) ("cochrun.xyz" :components ("home" "posts" "static")))) + + (setq org-html-postamble t + org-html-postamble-format '(("en" + ""))) :general (chris/leader-keys @@ -2355,11 +2357,14 @@ I'm going to find all kinds of uses for posframe #+end_src ** EWW +:PROPERTIES: +:ID: 20240526T142839.041746 +:END: Builtin webbrowser for emacs. Trying it out as a text only browser for things. #+begin_src emacs-lisp (setq home-directory "~/") -(defun chris/eww-mpv () +(defun chris/eww-empv () "Launch the url in mpv" (interactive) (let ((pt (avy-with ace-link-eww @@ -2370,9 +2375,15 @@ Builtin webbrowser for emacs. Trying it out as a text only browser for things. (when (number-or-marker-p pt) (goto-char pt) (let ((url (get-text-property (point) 'shr-url))) - (if (start-process "mpv" "mpv-output" "mpv" url) - (message (concat "mpv started => " url)) - (message "mpv failed, maybe this isn't a link?")))))) + (empv-play-or-enqueue (string-replace "inv.cochrun.xyz" "youtube.com" url)))))) + +(defun chris/search-yt () + "Search youtube in my own invidious instance + and show the results in eww." + (interactive) + (let* ((search (completing-read "YT Search: " nil)) + (url (url-encode-url (concat "https://inv.cochrun.xyz/search?q=" search)))) + (eww url))) ;; (defun chris/) diff --git a/init.el b/init.el index 374fb949..e9c8ba06 100644 --- a/init.el +++ b/init.el @@ -834,37 +834,39 @@ much faster. The hope is to also make this a faster version of imenu." (setq org-publish-project-alist `(("home" - :base-directory "~/docs/notes/site/" + :base-directory "~/docs/notes/site/content" :base-extension "org" :recursive nil :html-doctype "html5" :html-html5-fancy t :html-self-link-headlines t - :html-head "" - :publishing-directory "~/cochrun.xyz/" + :html-head "" + :publishing-directory "~/docs/notes/site/public/" :publishing-function org-html-publish-to-html) ("posts" - :base-directory "~/docs/notes/site/content/" + :base-directory "~/docs/notes/site/content/posts" :base-extension "org" :recursive t :html-doctype "html5" :html-html5-fancy t :html-self-link-headlines t :htmlized-source t - :html-head "" - :publishing-directory "~/cochrun.xyz/content/" + :html-head "" + :publishing-directory "~/docs/notes/site/public/content/" :publishing-function org-html-publish-to-html) ("static" :base-directory "~/docs/notes/site/assets/" :base-extension "css\\|txt\\|jpg\\|gif\\|png" - :exclude "bibles\\|.st.*\\|.templates" :recursive t :html-doctype "html5" :html-html5-fancy t - :html-head "" - :publishing-directory "~/cochrun.xyz/content/" + :publishing-directory "~/docs/notes/site/public/" :publishing-function org-publish-attachment) ("cochrun.xyz" :components ("home" "posts" "static")))) + + (setq org-html-postamble t + org-html-postamble-format '(("en" + ""))) :general (chris/leader-keys @@ -1757,7 +1759,7 @@ Optional BACKEND must be `re-reveal' or a backend derived from it." (setq vertico-posframe-min-height 10)) (setq home-directory "~/") -(defun chris/eww-mpv () +(defun chris/eww-empv () "Launch the url in mpv" (interactive) (let ((pt (avy-with ace-link-eww @@ -1768,9 +1770,15 @@ Optional BACKEND must be `re-reveal' or a backend derived from it." (when (number-or-marker-p pt) (goto-char pt) (let ((url (get-text-property (point) 'shr-url))) - (if (start-process "mpv" "mpv-output" "mpv" url) - (message (concat "mpv started => " url)) - (message "mpv failed, maybe this isn't a link?")))))) + (empv-play-or-enqueue (string-replace "inv.cochrun.xyz" "youtube.com" url)))))) + +(defun chris/search-yt () + "Search youtube in my own invidious instance + and show the results in eww." + (interactive) + (let* ((search (completing-read "YT Search: " nil)) + (url (url-encode-url (concat "https://inv.cochrun.xyz/search?q=" search)))) + (eww url))) ;; (defun chris/)