dotfiles

A steaming hot pile of sh...ell scripts and configuration files.
git clone https://kaka.farm/~git/dotfiles
Log | Files | Refs

commit aa823eb3f47ae8d0c0e236afa7e05071adaa7094
parent 79aa951e9e69e3b4abc096f6916475ed19be6725
Author: Yuval Langer <yuval.langer@gmail.com>
Date:   Mon, 20 May 2024 09:34:02 +0300

Consolidate functions into a single file and add my elfeed-feeds list.

Diffstat:
Aconfig/emacs/elfeed-feeds.el | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mconfig/emacs/init.el | 10++++------
Mconfig/emacs/kakafarm-utils.el | 93+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dconfig/emacs/org-roam-stuff.el | 74--------------------------------------------------------------------------
4 files changed, 163 insertions(+), 80 deletions(-)

diff --git a/config/emacs/elfeed-feeds.el b/config/emacs/elfeed-feeds.el @@ -0,0 +1,66 @@ +(require 'cl-lib) + +(setq elfeed-feeds + `(("https://acdw.casa/feed.xml" acdw activitypub blog craftering) + ("https://analognowhere.com/feed/rss.xml" comics) + ("https://blog.benoitj.ca/posts/index.xml" blog craftering) + ("https://blog.codeberg.org/feeds/all.atom.xml" codeberg) + ("https://blog.vaxry.net/feed" blog linux) + ("https://botsin.space/@mechilim/with_replies.rss" activitypub covid israel) + ("https://c.im/@NWengrov.rss" activitypub blog novartza) + ("https://cdn.jwz.org/blog/feed/" blog jwz) + ("https://chris-hughes.dev/rss" blog craftering) + ("https://christerpher.com/feed.xml" blog craftering) + ("https://chromefetus.thecomicseries.com/rss/" chromefetus comics) + ("https://davidson.weizmann.ac.il/rss.xml" davidson news science weizmann) + ("https://deidetected.com/index.php/comments/feed/" csj withreplies) + ("https://deidetected.com/index.php/feed/" csj) + ("https://drewdevault.com/blog/index.xml" blog drewdevault linux programming) + ("https://erictopol.substack.com/feed" covid erictopol science) + ("https://galperel.wordpress.com/feed/" books hebrew israel) + ("https://glenneth.srht.site/feed.xml" blog craftering) + ("https://hyperboleandahalf.blogspot.com/feeds/posts/default" blog comics) + ("https://internet-israel.com/feed/" internet israel) + ("https://kaka.farm/haunt/feed.xml" blog self craftering) + ("https://kaka.farm/~brownjenkin/feeds/all.atom.xml" blog self) + ("https://lemmy.sdf.org/feeds/c/unix_surrealism.xml" comics unixsurrealism) + ("https://libera.chat/atom.xml" blog irc liberachat news) + ("https://luminousnine.com/feed.xml" blog craftering) + ("https://masto.ai/@johnsnowproject/with_replies.rss" activitypub corona covid) + ("https://merveilles.town/tags/unix_surrealism.rss" comics unixsurrealism) + ("https://mstdn.social/@erictopol.rss" activitypub covid erictopol science) + ("https://mstdn.social/@erictopol/with_replies.rss" activitypub covid erictopol science) + ("https://odysee.com/$/rss/@ArkhamReporter:5" arkhamreporter lovecraft video) + ("https://planet.debian.org/rss20.xml" blog debian linux) + ("https://planet.scheme.org/atom.xml" lisp planet scheme) + ("https://puri.sm/feed/" linux purism) + ("https://sfba.social/@danielmingram/with_replies.rss" activitypub danielmingram) + ("https://shakuf.co.il/feed" israel news shakuf) + ("https://shom.dev/index.xml" blog linux craftering) + ("https://spritely.institute/feed.xml" linux lisp scheme) + ("https://status.mangadex.org/history.atom" comics) + ("https://systemcrafters.net/rss/news.xml" emacs guile guix linux lisp news scheme) + ("https://thanosapollo.org/index.xml" blog craftering) + ("https://tooot.im/@NWengrov.rss" activitypub blog novartza) + ("https://tooot.im/@admin.rss" activitypub admin) + ("https://trevarj.github.io/rss.xml" blog craftering) + ("https://vimeo.com/user13532867/videos/rss" danielmingram meditation) + ("https://whatsup.org.il/backend-forums.php?utf8=1" israel linux whatsup) + ("https://whatsup.org.il/backend.php?utf8=1" israel linux whatsup) + ("https://www.accursedfarms.com/rss/3-accursed-farms.xml/" accursedfarms blog) + ("https://www.blipanika.co.il/?feed=rss2" israel scifi) + ("https://www.debian.org/News/news" debian linux news) + ("https://www.goominet.com/unspeakable-vault/?type=103" comics) + ("https://www.ha-makom.co.il/feed/" hamakom israel news) + ("https://www.hayadan.org.il/feed" hayadan news science) + ("https://www.linux.com/feed/" linux) + ("https://www.livejournal.com/allpics.bml?user=oglafcomics" comics) + ("https://www.midaat.org.il/feed/" conspiracy medicine midaat science) + ("https://www.rahuljuliato.com/rss.xml" blog craftering) + ("https://www.rifters.com/crawl/?feed=rss2" blog peterwatts scifi) + ("https://www.snamellit.com/rss.xml" blog craftering) + ("https://www.the7eye.org.il/feed" israel news the7eye) + ("https://www.wheresyoured.at/rss/" blog news tech) + (,(concat "https://rss.samharris.org/feed/" + kakafarm/elfeed-making-sense-with-sam-harris-podcast-secret-feed-key) + podcast))) diff --git a/config/emacs/init.el b/config/emacs/init.el @@ -11,7 +11,8 @@ (require 'benchmark-init) -(load (concat user-emacs-directory "kakafarm-utils.el")) +(load (locate-user-emacs-file "kakafarm-utils.el")) +(load (locate-user-emacs-file "local-stuff.el")) '(setq package-archives '()) (require 'use-package) @@ -24,8 +25,7 @@ :config ;; Use another file for the ``customize'' customisations. (setq custom-file (locate-user-emacs-file "custom-variables.el")) - (load custom-file 'noerror 'nomessage) - (load (locate-user-emacs-file "local-stuff.el"))) + (load custom-file 'noerror 'nomessage)) (use-package dictionary :config @@ -33,7 +33,7 @@ (use-package elfeed :config - (load (concat user-emacs-directory "elfeeds.el"))) + (load (locate-user-emacs-file "elfeed-feeds.el"))) (use-package geiser :after (scheme-mode) @@ -189,8 +189,6 @@ (progn ;; Load org-roam stuff. - (load (concat user-emacs-directory "org-roam-stuff.el")) - (setq kakafarm/org-roam-my-publish-time 0) (setq org-publish-project-alist diff --git a/config/emacs/kakafarm-utils.el b/config/emacs/kakafarm-utils.el @@ -108,3 +108,96 @@ https://www.tomsdiner.org/blog/post_0003_sourcehut_readme_org_export.html" (when buffer-read-only (setq-local sentence-end-double-space nil))) + +(defun kakafarm/elfeed-sort-feeds () + `(setq elfeed-feeds + ,(sort + (mapcar + (lambda (a-feed) + (let* ((feed-url (car a-feed)) + (tags (cdr a-feed)) + (tags-as-strings (mapcar #'symbol-name + tags)) + (sorted-tags (sort tags-as-strings + #'string-lessp)) + (tags-as-symbols (mapcar #'intern sorted-tags))) + (cons feed-url sorted-tags))) + elfeed-feeds) + (lambda (feed-a feed-b) + (string-lessp (car feed-a) + (car feed-b)))))) + +(defun kakafarm/org-roam-keyword-is-filetags-p (keyword-node) + (equal (org-element-property :key + keyword-node) + "FILETAGS")) + +(defun kakafarm/org-roam-filetags-keyword-is-publishable-p (filestags-keyword-node) + (seq-contains-p (split-string (org-element-property :value + filestags-keyword-node) + ":") + "publish")) + +(defun kakafarm/org-roam-publishable-node-p (org-filename) + (with-temp-buffer + (insert-file-contents org-filename) + (org-element-map (org-element-parse-buffer) 'keyword + (lambda (keyword) + (and (kakafarm/org-roam-keyword-is-filetags-p keyword) + (kakafarm/org-roam-filetags-keyword-is-publishable-p keyword))) + nil + t))) + +(defun kakafarm/org-roam-sitemap (title list-of-org-links) + (message (format "kakafarm/org-roam-sitemap title: %S; list-of-links: %S\n" + title + list-of-org-links)) + ;; (let ((a-publishable-org-roam-node + ;; (seq-filter (lambda (org-link-list) + ;; (pcase org-link-list + ;; (`(,org-link) + ;; (with-temp-buffer + ;; (insert org-link) + ;; (org-element-map (org-element-parse-buffer) 'link + ;; (lambda (link) + ;; ;; Check if file linked is publishable. + ;; (kakafarm/org-roam-publishable-node-p + ;; (concat "~/mine/roam/" + ;; (org-element-property :path + ;; link)))) + ;; nil + ;; t))))) + ;; list-of-org-links))) + ;; (message "poop %S" a-publishable-org-roam-node)) + + (concat + "# -*- encoding: utf-8 -*-\n" + "#+OPTIONS: ^:nil author:nil html-postamble:nil\n" + ;;"#SETUPFILE: ./simple_inline.theme\n" ; No theme yet. + "#+FILETAGS: publish\n" + "#+TITLE: " title "\n\n" + (org-list-to-org list-of-org-links) "\n" + + ;; TODO: No sitemap SVG yet because it shows all the fucking + ;; files in the org-roam database. + ;; + ;;"file:sitemap.svg\n" + )) + +(defun kakafarm/org-roam-publication-wrapper (plist filename pubdir) + ;; (when (kakafarm/org-roam-publishable-node-p filename) + ;; nil) + ;;(org-roam-graph) ; How the fuck do I make this one not show every fucking node in the org-roam database?! + (org-html-publish-to-html plist + filename + pubdir) + (setq kakafarm/org-roam-project-publish-time + (cadr (current-time)))) + +(defun kakafarm/org-roam-custom-link-builder (node) + (let ((node-file (org-roam-node-file node))) + ;; (when (kakafarm/org-roam-publishable-node-p node-file) + ;; nil) + (message (format "kakafarm/org-roam-custom-link-builder: %S" node)) + (concat (file-name-base node-file) + ".html"))) diff --git a/config/emacs/org-roam-stuff.el b/config/emacs/org-roam-stuff.el @@ -1,74 +0,0 @@ -(defun kakafarm/org-roam-keyword-is-filetags-p (keyword-node) - (equal (org-element-property :key - keyword-node) - "FILETAGS")) - -(defun kakafarm/org-roam-filetags-keyword-is-publishable-p (filestags-keyword-node) - (seq-contains-p (split-string (org-element-property :value - filestags-keyword-node) - ":") - "publish")) - -(defun kakafarm/org-roam-publishable-node-p (org-filename) - (with-temp-buffer - (insert-file-contents org-filename) - (org-element-map (org-element-parse-buffer) 'keyword - (lambda (keyword) - (and (kakafarm/org-roam-keyword-is-filetags-p keyword) - (kakafarm/org-roam-filetags-keyword-is-publishable-p keyword))) - nil - t))) - -(defun kakafarm/org-roam-sitemap (title list-of-org-links) - (message (format "kakafarm/org-roam-sitemap title: %S; list-of-links: %S\n" - title - list-of-org-links)) - ;; (let ((a-publishable-org-roam-node - ;; (seq-filter (lambda (org-link-list) - ;; (pcase org-link-list - ;; (`(,org-link) - ;; (with-temp-buffer - ;; (insert org-link) - ;; (org-element-map (org-element-parse-buffer) 'link - ;; (lambda (link) - ;; ;; Check if file linked is publishable. - ;; (kakafarm/org-roam-publishable-node-p - ;; (concat "~/mine/roam/" - ;; (org-element-property :path - ;; link)))) - ;; nil - ;; t))))) - ;; list-of-org-links))) - ;; (message "poop %S" a-publishable-org-roam-node)) - - (concat - "# -*- encoding: utf-8 -*-\n" - "#+OPTIONS: ^:nil author:nil html-postamble:nil\n" - ;;"#SETUPFILE: ./simple_inline.theme\n" ; No theme yet. - "#+FILETAGS: publish\n" - "#+TITLE: " title "\n\n" - (org-list-to-org list-of-org-links) "\n" - - ;; TODO: No sitemap SVG yet because it shows all the fucking - ;; files in the org-roam database. - ;; - ;;"file:sitemap.svg\n" - )) - -(defun kakafarm/org-roam-publication-wrapper (plist filename pubdir) - ;; (when (kakafarm/org-roam-publishable-node-p filename) - ;; nil) - ;;(org-roam-graph) ; How the fuck do I make this one not show every fucking node in the org-roam database?! - (org-html-publish-to-html plist - filename - pubdir) - (setq kakafarm/org-roam-project-publish-time - (cadr (current-time)))) - -(defun kakafarm/org-roam-custom-link-builder (node) - (let ((node-file (org-roam-node-file node))) - ;; (when (kakafarm/org-roam-publishable-node-p node-file) - ;; nil) - (message (format "kakafarm/org-roam-custom-link-builder: %S" node)) - (concat (file-name-base node-file) - ".html")))