adding some tweaks to eww and empv

This commit is contained in:
Chris Cochrun 2024-05-28 10:07:32 -05:00
parent ecf67be595
commit ef40efc886
2 changed files with 45 additions and 26 deletions

View file

@ -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 "<link rel=\"stylesheet\" href=\"content/pico/css/pico.css\" type=\"text/css\"/>"
:publishing-directory "~/cochrun.xyz/"
:html-head "<link rel=\"stylesheet\" href=\"pico.css\" type=\"text/css\"/>"
: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 "<link rel=\"stylesheet\" href=\"pico/css/pico.css\" type=\"text/css\"/>"
:publishing-directory "~/cochrun.xyz/content/"
:html-head "<link rel=\"stylesheet\" href=\"../pico.css\" type=\"text/css\"/>"
: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 "<link rel=\"stylesheet\" href=\"pico/css/pico.css\" type=\"text/css\"/>"
: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"
"<footer> <p>Author: %a (%e)</p></footer>")))
: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/)

34
init.el
View file

@ -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 "<link rel=\"stylesheet\" href=\"content/pico/css/pico.css\" type=\"text/css\"/>"
:publishing-directory "~/cochrun.xyz/"
:html-head "<link rel=\"stylesheet\" href=\"pico.css\" type=\"text/css\"/>"
: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 "<link rel=\"stylesheet\" href=\"pico/css/pico.css\" type=\"text/css\"/>"
:publishing-directory "~/cochrun.xyz/content/"
:html-head "<link rel=\"stylesheet\" href=\"../pico.css\" type=\"text/css\"/>"
: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 "<link rel=\"stylesheet\" href=\"pico/css/pico.css\" type=\"text/css\"/>"
: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"
"<footer> <p>Author: %a (%e)</p></footer>")))
: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/)