diff --git a/config.el b/config.el index 1729440..b914c44 100644 --- a/config.el +++ b/config.el @@ -22,10 +22,25 @@ ;; (setq doom-font (font-spec :family "monospace" :size 12 :weight 'semi-light) ;; doom-variable-pitch-font (font-spec :family "sans" :size 13)) +(setq doom-font (font-spec :family "PragmataPro Liga" :size 20) + doom-variable-pitch-font (font-spec :family "PragmataPro Liga" :size 20) ; inherits `doom-font''s :size + doom-unicode-font (font-spec :family "PragmataPro Liga" :size 12) + doom-big-font (font-spec :family "PragmataPro Liga" :size 30)) + +(if (eq system-type 'gnu/linux) + (progn + (add-to-list 'default-frame-alist '(top . 400)) + (add-to-list 'default-frame-alist '(left . 750)) + (add-to-list 'default-frame-alist '(height . 60)) + (add-to-list 'default-frame-alist '(width . 235)) + )) + ;; There are two ways to load a theme. Both assume the theme is installed and ;; available. You can either set `doom-theme' or manually load a theme with the ;; `load-theme' function. This is the default: +;; (setq doom-theme 'doom-one) (setq doom-theme 'doom-one) +;; (delq! t custom-theme-load-path) ;; If you use `org' and don't want your org files in the default location below, ;; change `org-directory'. It must be set before org loads! @@ -35,16 +50,7 @@ ;; numbers are disabled. For relative line numbers, set this to `relative'. (setq display-line-numbers-type t) -(cond ((member "PragmataPro Liga" (font-family-list)) - (set-face-attribute 'default nil :font "PragmataPro Liga-15"))) -(if (eq system-type 'gnu/linux) - (progn - (add-to-list 'default-frame-alist '(top . 400)) - (add-to-list 'default-frame-alist '(left . 750)) - (add-to-list 'default-frame-alist '(height . 60)) - (add-to-list 'default-frame-alist '(width . 235)) - )) ;; Here are some additional functions/macros that could help you configure Doom: ;; @@ -63,33 +69,149 @@ ;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how ;; they are implemented. -(if (file-exists-p "~/.doom.d/functions.el") - (progn - (load-file "~/.doom.d/functions.el") - (require 'functions)) - (message "\"~/.doom.d/functions.el\" does not exist" )) +(load! "functions.el") +(use-package! functions) + +(load! "fancy-banner.el") +(use-package! fancy-banner) + +(load! "setup-elfeed.el") +(use-package! setup-elfeed) + +(map! :map global-map + :prefix "C-x" + "C-l" nil + (:prefix ("C-l" . "launch") + "a" #'org-agenda + "e" #'elfeed)) + + + +(use-package! org + :commands org-capture + :mode ("\\.org\\'" . org-mode) + :bind ( + ("C-," . org-cycle-agenda-files) + ("C-c C-d" . org-capture) + :map org-mode-map + ("M-n" . leo/org-narrow-next-tree) + ("M-p" . leo/org-narrow-prev-tree) + ("M-P" . leo/org-present) + ) + :preface + (defvar org-html-validation-link) + (defvar org-html-text-markup-alist) + (defvar org-capture-templates) + :init + (setq org-agenda-files '("/mnt/c/Users/Levi/Nextcloud/Org/todo.org" + "/mnt/c/Users/Levi/Nextcloud/Org/projects.org" + "/mnt/c/Users/Levi/Nextcloud/Org/Recipies.org" + "/mnt/c/Users/Levi/Nextcloud/Org/help.org" + "/mnt/c/Users/Levi/Nextcloud/Org/personal.org" + "/mnt/c/Users/Levi/Nextcloud/Org/archive.org" + )) + (setq org-agenda-include-diary t) + (add-to-list 'safe-local-variable-values '(eval leo/deft-insert-boilerplate)) + (setq org-refile-targets '((nil :maxlevel . 3) + (org-agenda-files :maxlevel . 3)) + org-directory "/mnt/c/Users/Levi/Nextcloud/Org" + org-default-notes-file (concat org-directory "/todo.org")) + :config + (setq org-capture-templates + '(("t" "new task" entry (file+headline "/mnt/c/Users/Levi/Nextcloud/Org/todo.org" "Tasks") + "* TODO [#A] %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n%a\n") + ("n" "new note" entry (file+headline org-default-notes-file "Notes") + "* %?\n%i\n") + ("l" "store link" entry (file+olp org-default-notes-file "Links" "Unfiled") + "* %a\n%?\n") + ("d" "store link w/drawer" entry (file+olp org-default-notes-file "Links" "Unfiled") + "* %?\n%l\n:COPIED_TEXT:\n %i\n:END:\n") + )) + (setq org-structure-template-alist + '(("r" . "src restclient :results raw") + ("j" . "src js :cmd \"/usr/local/bin/babel-node\" :results output code") + ("e" . "src emacs-lisp :results silent") + ("a" . "export ascii") + ("c" . "center") + ("C" . "comment") + ("E" . "export") + ("h" . "export html") + ("l" . "export latex") + ("q" . "quote") + ("s" . "src") + ("v" . "verse"))) + (defconst checkbox-fontlock-keywords-alist + (mapcar (lambda (regex-char-pair) + `(,(car regex-char-pair) + (0 (prog1 () + (compose-region (match-beginning 1) + (match-end 1) + ,(concat (list ?\C-i) + (list (decode-char 'ucs (cadr regex-char-pair))))))))) + '(("\\(\\[ \\]\\)" #XF096);2B1C + ("\\(\\[-\\]\\)" #XF147);29C7;F458 + ("\\(\\[X\\]\\)" #XF046);2BBD + ))) + + (defun add-checkbox-symbol-keywords () + "Add checkbox font to font-lock." + (font-lock-add-keywords nil checkbox-fontlock-keywords-alist)) + + (add-hook 'org-mode-hook 'add-checkbox-symbol-keywords) + ) + +(use-package! org-roam + :hook + (org-mode . org-roam-mode) + :config + (org-roam-db-build-cache) + (setq org-roam-directory "/mnt/c/Users/Levi/Nextcloud/Org/Roam/") + (setq org-roam-link-title-format "r::%s")) + +(use-package! deft + :bind + ("C-c n d" . deft) + :custom + (deft-recursive t) + (deft-use-filter-string-for-filename t) + (deft-default-extension "org") + (deft-directory "/mnt/c/Users/Levi/Nextcloud/Org/Roam/")) + +(use-package! lsp-java + :config + (setq lsp-ui-doc-include-signature t + lsp-ui-doc-enable t + lsp-ui-sideline-enable t) + (add-hook 'java-mode-hook #'lsp-deferred) + (add-hook 'java-mode-hook #'lsp-lens-mode) + ;; (add-hook 'java-mode-hook #'lsp-java-boot-lens-mode) + (add-hook 'java-mode-hook #'lsp-ui-mode)) + +(add-hook 'css-mode-hook #'lsp-deferred) +(add-hook 'js-mode-hook #'lsp-deferred) (map! :map global-map - "M-t" 'treemacs-select-window - "M-q" 'leo/kill-this-buffer-unless-scratch - - "C-" 'leo/tidy - "C-;" 'leo/comment-or-uncomment-region-or-line - "C-c C-e" 'leo/edit-config - "C-c d" 'leo/duplicate-thing - "M-n" 'leo/jump-to-next-symbol - "M-p" 'leo/jump-to-prev-symbol - "M-u" 'upcase-dwim - "M-c" 'capitalize-dwim - "M-l" 'downcase-dwim - - "C-c b" 'ivy-switch-buffer - "C-s" 'swiper - - "C-}" 'mc/mark-next-like-this - "C-)" 'mc/unmark-next-like-this - "C-{" 'mc/mark-previous-like-this - "C-(" 'mc/unmark-previous-like-this - "C-@" 'er/expand-region - "C-#" 'er/contract-region + "M-t" #'treemacs-select-window + "M-q" #'leo/kill-this-buffer-unless-scratch + "M-RET" #'lsp-ui-doc-glance + + "C-" #'leo/tidy + "C-;" #'leo/comment-or-uncomment-region-or-line + "C-c C-e" #'leo/edit-config + "C-c d" #'leo/duplicate-thing + "M-n" #'leo/jump-to-next-symbol + "M-p" #'leo/jump-to-prev-symbol + "M-u" #'upcase-dwim + "M-c" #'capitalize-dwim + "M-l" #'downcase-dwim + + "C-c b" #'ivy-switch-buffer + "C-s" #'swiper + + "C-}" #'mc/mark-next-like-this + "C-)" #'mc/unmark-next-like-this + "C-{" #'mc/mark-previous-like-this + "C-(" #'mc/unmark-previous-like-this + "C-@" #'er/expand-region + "C-#" #'er/contract-region ) diff --git a/custom.el b/custom.el new file mode 100644 index 0000000..a70d596 --- /dev/null +++ b/custom.el @@ -0,0 +1,17 @@ +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(package-selected-packages (quote (org-bullets))) + '(safe-local-variable-values + (quote + ((eval leo/deft-insert-boilerplate) + (visual-line-mode . 1) + (whitespace-line-column . 120))))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) diff --git a/fancy-banner.el b/fancy-banner.el new file mode 100644 index 0000000..a523231 --- /dev/null +++ b/fancy-banner.el @@ -0,0 +1,116 @@ +;;; fancy-banner.el -*- lexical-binding: t; -*- +;;; Commentary: +;; +;; See https://github.com/tecosaur/emacs-config/blob/master/config.org +;; +;;; Code: +;;; +(setq +doom-dashboard--width 120) + +(defvar fancy-splash-image-template + (expand-file-name "misc/splash-images/blackhole-lines-template.svg" doom-private-dir) + "Default template svg used for the splash image, with substitutions from ") +(defvar fancy-splash-image-nil + (expand-file-name "misc/splash-images/transparent-pixel.png" doom-private-dir) + "An image to use at minimum size, usually a transparent pixel") + +(defvar fancy-splash-sizes + `((:height 400 :min-height 50 :padding (0 . 2)) + (:height 350 :min-height 42 :padding (1 . 4)) + (:height 300 :min-height 35 :padding (1 . 3)) + (:height 250 :min-height 30 :padding (1 . 2)) + (:height 0 :min-height 0 :padding (0 . 0) :file ,fancy-splash-image-nil)) + "list of plists with the following properties + :height the height of the image + :min-height minimum `frame-height' for image + :padding `+doom-dashboard-banner-padding' to apply + :template non-default template file + :file file to use instead of template") + +(setq fancy-splash-sizes + `((:height 400 :min-height 40 :padding (0 . 4) :template ,(expand-file-name "misc/splash-images/blackhole-lines-0.svg" doom-private-dir)) + (:height 350 :min-height 32 :padding (1 . 4) :template ,(expand-file-name "misc/splash-images/blackhole-lines-0.svg" doom-private-dir)) + (:height 300 :min-height 28 :padding (1 . 4) :template ,(expand-file-name "misc/splash-images/blackhole-lines-1.svg" doom-private-dir)) + (:height 250 :min-height 26 :padding (1 . 3) :template ,(expand-file-name "misc/splash-images/blackhole-lines-2.svg" doom-private-dir)) + (:height 200 :min-height 24 :padding (1 . 3) :template ,(expand-file-name "misc/splash-images/blackhole-lines-3.svg" doom-private-dir)) + (:height 150 :min-height 22 :padding (1 . 2) :template ,(expand-file-name "misc/splash-images/blackhole-lines-4.svg" doom-private-dir)) + (:height 100 :min-height 20 :padding (1 . 2) :template ,(expand-file-name "misc/splash-images/blackhole-lines-5.svg" doom-private-dir)) + (:height 100 :min-height 14 :padding (1 . 2) :template ,(expand-file-name "misc/splash-images/emacs-e-template.svg" doom-private-dir)) + (:height 0 :min-height 0 :padding (0 . 0) :file ,fancy-splash-image-nil))) + + +(defvar fancy-splash-template-colours + '(("$colour1" . keywords) ("$colour2" . type) ("$colour3" . base5) ("$colour4" . base8)) + "list of colour-replacement alists of the form (\"$placeholder\" . 'theme-colour) which applied the template") + +(unless (file-exists-p (expand-file-name "theme-splashes" doom-cache-dir)) + (make-directory (expand-file-name "theme-splashes" doom-cache-dir) t)) + +(defun fancy-splash-filename (theme-name height) + (expand-file-name (concat (file-name-as-directory "theme-splashes") + theme-name + "-" (number-to-string height) ".svg") + doom-cache-dir)) + +(defun fancy-splash-clear-cache () + "Delete all cached fancy splash images" + (interactive) + (delete-directory (expand-file-name "theme-splashes" doom-cache-dir) t) + (message "Cache cleared!")) + +(defun fancy-splash-generate-image (template height) + "Read TEMPLATE and create an image if HEIGHT with colour substitutions as + described by `fancy-splash-template-colours' for the current theme" + (with-temp-buffer + (insert-file-contents template) + (re-search-forward "$height" nil t) + (replace-match (number-to-string height) nil nil) + (dolist (substitution fancy-splash-template-colours) + (goto-char (point-min)) + (while (re-search-forward (car substitution) nil t) + (replace-match (doom-color (cdr substitution)) nil nil))) + (write-region nil nil + (fancy-splash-filename (symbol-name doom-theme) height) nil nil))) + +(defun fancy-splash-generate-images () + "Perform `fancy-splash-generate-image' in bulk" + (dolist (size fancy-splash-sizes) + (unless (plist-get size :file) + (fancy-splash-generate-image (or (plist-get size :file) + (plist-get size :template) + fancy-splash-image-template) + (plist-get size :height))))) + +(defun ensure-theme-splash-images-exist (&optional height) + (unless (file-exists-p (fancy-splash-filename + (symbol-name doom-theme) + (or height + (plist-get (car fancy-splash-sizes) :height)))) + (fancy-splash-generate-images))) + +(defun get-appropriate-splash () + (let ((height (frame-height))) + (cl-some (lambda (size) (when (>= height (plist-get size :min-height)) size)) + fancy-splash-sizes))) + +(setq fancy-splash-last-size nil) +(setq fancy-splash-last-theme nil) +(defun set-appropriate-splash (&rest _) + (let ((appropriate-image (get-appropriate-splash))) + (unless (and (equal appropriate-image fancy-splash-last-size) + (equal doom-theme fancy-splash-last-theme))) + (unless (plist-get appropriate-image :file) + (ensure-theme-splash-images-exist (plist-get appropriate-image :height))) + (setq fancy-splash-image + (or (plist-get appropriate-image :file) + (fancy-splash-filename (symbol-name doom-theme) (plist-get appropriate-image :height)))) + (setq +doom-dashboard-banner-padding (plist-get appropriate-image :padding)) + (setq fancy-splash-last-size appropriate-image) + (setq fancy-splash-last-theme doom-theme) + (+doom-dashboard-reload))) + +(add-hook 'window-size-change-functions #'set-appropriate-splash) +(add-hook 'doom-load-theme-hook #'set-appropriate-splash) + +(provide 'fancy-banner) +;; fancy-banner.el ends here diff --git a/functions.el b/functions.el index 4624476..c06f11a 100644 --- a/functions.el +++ b/functions.el @@ -74,5 +74,103 @@ (interactive) (leo/jump-to-symbol)) +(defun leo/org-global-props (&optional property buffer) + "Get the plists of global org PROPERTY of current BUFFER." + (unless property (setq property "PROPERTY")) + (with-current-buffer (or buffer (current-buffer)) + (org-element-map (org-element-parse-buffer) 'keyword (lambda (el) (when (string-match property (org-element-property :key el)) el))))) + +(defun leo/org-global-prop-value (key) + "Get global org property KEY (case sensitive) of current buffer." + (org-element-property :value (car (leo/org-global-props key)))) + +(defun leo/deft-insert-boilerplate () + "Insert boilerplate into newly create roam note." + (interactive) + (let ((title (leo/org-global-prop-value "TITLE")) + (setupfile (leo/org-global-prop-value "SETUPFILE")) + (startup (leo/org-global-prop-value "STARTUP"))) + ;; If we have neither SETUPFILE nor STARTUP + (when (and title + (not setupfile) + (not startup)) + (kill-region (point-min) (point-max)) + (goto-char (point-min)) + (insert (format "#+TITLE: %s\n" title)) + (insert "#+SETUPFILE: setup.org\n") + (insert "\n") + (insert "* Metadata:\n") + (insert "** Tags: ") + (goto-char (point-max))) + + ;; If we only have STARTUP + (when (and title + startup + (not setupfile)) + (goto-char (point-min)) + (search-forward "STARTUP") + (beginning-of-line) + (kill-line) + (insert "#+SETUPFILE: setup.org") + (message "Updated Global Properties")) + )) + +(defun leo/org-narrow-prev-tree () + "When in a narrowed region, this will take you to the previous heading and narrow." + (interactive) + (goto-char (point-min)) + (widen) + (org-backward-heading-same-level 1) + (org-narrow-to-subtree)) + +(defun leo/org-narrow-next-tree () + "When in a narrowed region, this will take you to the next heading and narrow." + (interactive) + (goto-char (point-min)) + (widen) + (org-forward-heading-same-level 1) + (org-narrow-to-subtree)) + +(defun leo/org-present () + "Begin an `org-mode' presentation." + (interactive) + (defvar old-mlf nil "Temp storage of mode-line-format while in 'present mode'.") + (if (buffer-narrowed-p) + (progn + (widen) + (setq mode-line-format old-mlf) + (setq cursor-type 'box) + (read-only-mode -1) + (text-scale-adjust 0) + (visual-line-mode nil) + (toggle-word-wrap nil) + (message "No longer presenting") + ) + (setq old-mlf mode-line-format) + (setq mode-line-format nil) + (org-narrow-to-subtree) + (setq cursor-type 'hbar) + (read-only-mode 1) + (text-scale-adjust 5) + (visual-line-mode 1) + (toggle-word-wrap 1) + (message "Presenting") + )) + +(defun leo/org-roam-reformat-tags () + "Search for Tags: in document and replace the old single-line format with a newline separated list." + (interactive) + ;; (save-excursion + ;; (goto-char (point-min)) + ;; (if (re-search-forward "Tags:") + ;; (progn + ;; (replace-regexp "Tags: \\[" "Tags:\n- [" nil (point-at-bol) (point-at-eol)) + ;; (replace-regexp "\\] \\[" "] \n- [" nil (point-at-bol) (point-at-eol)) + ;; (message "Tags formatted!") + ;; ) + ;; (message "Tags not found, format aborted"))) + ) + + (provide 'functions) ;;; functions.el ends here diff --git a/init.el b/init.el index 341d3fd..467a76c 100644 --- a/init.el +++ b/init.el @@ -87,20 +87,20 @@ ;;ansible ;;debugger ; FIXME stepping through code, to help you add bugs ;;direnv - ;;docker + docker ;;editorconfig ; let someone else argue about tabs vs spaces ;;ein ; tame Jupyter notebooks with emacs (eval +overlay) ; run code, run (also, repls) ;;gist ; interacting with github gists lookup ; navigate your code and its documentation - lsp + (lsp +peek) magit ; a git porcelain for Emacs ;;make ; run make tasks from Emacs ;;pass ; password manager for nerds ;;pdf ; pdf enhancements ;;prodigy ; FIXME managing external services & code builders ;;rgb ; creating color strings - ;;taskrunner ; taskrunner for all your projects + taskrunner ; taskrunner for all your projects ;;terraform ; infrastructure as code ;;tmux ; an API for interacting with tmux ;;upload ; map local to remote projects via ssh/ftp @@ -117,7 +117,7 @@ ;;coq ; proofs-as-programs ;;crystal ; ruby at the speed of c ;;csharp ; unity, .NET, and mono shenanigans - ;;data ; config/data formats + data ; config/data formats ;;(dart +flutter) ; paint ui and not much else ;;elixir ; erlang done right ;;elm ; care for a cup of TEA? @@ -128,25 +128,25 @@ ;;fsharp ; ML stands for Microsoft's Language ;;fstar ; (dependent) types and (monadic) effects and Z3 ;;gdscript ; the language you waited for - ;;(go +lsp) ; the hipster dialect + (go +lsp) ; the hipster dialect ;;(haskell +dante) ; a language that's lazier than I am ;;hy ; readability of scheme w/ speed of python ;;idris ; a language you can depend on - json ; At least it ain't XML + (json +lsp) ; At least it ain't XML (java +lsp) ; the poster child for carpal tunnel syndrome - javascript ; all(hope(abandon(ye(who(enter(here)))))) + (javascript +lsp) ; all(hope(abandon(ye(who(enter(here)))))) ;;julia ; a better, faster MATLAB ;;kotlin ; a better, slicker Java(Script) ;;latex ; writing papers in Emacs has never been so fun ;;lean ;;factor - ;;ledger ; an accounting system in Emacs + ledger ; an accounting system in Emacs ;;lua ; one-based indices? one-based indices markdown ; writing docs for people to ignore ;;nim ; python + lisp at the speed of c ;;nix ; I hereby declare "nix geht mehr!" ;;ocaml ; an objective camel - org ; organize your plain life in plain text + (org +dragndrop +pretty +roam) ; organize your plain life in plain text ;;php ; perl's insecure younger brother ;;plantuml ; diagrams for confusing people more ;;purescript ; javascript, but functional @@ -154,7 +154,7 @@ ;;qt ; the 'cutest' gui framework ever ;;racket ; a DSL for DSLs ;;raku ; the artist formerly known as perl6 - ;;rest ; Emacs as a REST client + rest ; Emacs as a REST client ;;rst ; ReST in peace ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} ;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() diff --git a/misc/splash-images/blackhole-lines-0.svg b/misc/splash-images/blackhole-lines-0.svg new file mode 100644 index 0000000..077b107 --- /dev/null +++ b/misc/splash-images/blackhole-lines-0.svg @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/misc/splash-images/blackhole-lines-1.svg b/misc/splash-images/blackhole-lines-1.svg new file mode 100644 index 0000000..19f704f --- /dev/null +++ b/misc/splash-images/blackhole-lines-1.svg @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/misc/splash-images/blackhole-lines-2.svg b/misc/splash-images/blackhole-lines-2.svg new file mode 100644 index 0000000..00b9b58 --- /dev/null +++ b/misc/splash-images/blackhole-lines-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/misc/splash-images/blackhole-lines-3.svg b/misc/splash-images/blackhole-lines-3.svg new file mode 100644 index 0000000..c65b253 --- /dev/null +++ b/misc/splash-images/blackhole-lines-3.svg @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/misc/splash-images/blackhole-lines-4.svg b/misc/splash-images/blackhole-lines-4.svg new file mode 100644 index 0000000..1ea1dcc --- /dev/null +++ b/misc/splash-images/blackhole-lines-4.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/misc/splash-images/blackhole-lines-5.svg b/misc/splash-images/blackhole-lines-5.svg new file mode 100644 index 0000000..a395670 --- /dev/null +++ b/misc/splash-images/blackhole-lines-5.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/misc/splash-images/blackhole-lines-6.svg b/misc/splash-images/blackhole-lines-6.svg new file mode 100644 index 0000000..600d624 --- /dev/null +++ b/misc/splash-images/blackhole-lines-6.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/misc/splash-images/blackhole-lines.svg b/misc/splash-images/blackhole-lines.svg new file mode 100644 index 0000000..ec332c7 --- /dev/null +++ b/misc/splash-images/blackhole-lines.svg @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/misc/splash-images/emacs-e-template.svg b/misc/splash-images/emacs-e-template.svg new file mode 100644 index 0000000..77b6469 --- /dev/null +++ b/misc/splash-images/emacs-e-template.svg @@ -0,0 +1,4 @@ + + + diff --git a/misc/splash-images/transparent-pixel.png b/misc/splash-images/transparent-pixel.png new file mode 100644 index 0000000..909c66d Binary files /dev/null and b/misc/splash-images/transparent-pixel.png differ diff --git a/packages.el b/packages.el index 17adf84..2749879 100644 --- a/packages.el +++ b/packages.el @@ -55,3 +55,5 @@ ;; ENABLE +(package! lsp-treemacs) +(package! elfeed) diff --git a/setup-elfeed.el b/setup-elfeed.el new file mode 100644 index 0000000..5501101 --- /dev/null +++ b/setup-elfeed.el @@ -0,0 +1,65 @@ +;;; setup-elfeed.el -*- lexical-binding: t; -*- + + +(map! ;; "C-x C-l e" to launch is defined in =config.el= + :map elfeed-search-mode-map + "a" #'(lambda () (interactive) (elfeed-search-set-filter "")) + "e" #'(lambda () (interactive) (elfeed-search-set-filter "+emacs")) + "x" #'(lambda () (interactive) (elfeed-search-set-filter "xkcd")) + "v" #'(lambda () (interactive) (elfeed-search-set-filter "+youtube")) + "=" #'elfeed-search-set-filter) + +(use-package! elfeed + :init + (setq elfeed-feeds + '( + ("https://insideevs.com/rss/make/tesla/" news tesla ev) + ("https://insideevs.com/rss/make/rivian/" news rivian ev) + ("https://insideevs.com/rss/category/battery-tech/" news battery ev) + ("https://www.google.com/alerts/feeds/13353713273807811484/17577790586956417498" news google cybertruck tesla ev) + ("https://www.google.com/alerts/feeds/13353713273807811484/2710948715805064535" news google tesla ev) + ("https://www.google.com/alerts/feeds/13353713273807811484/17638090915837343269" news google pixel4) + + ("https://teslapodcast.libsyn.com/rss" podcast tesla ev) + ("http://feeds.twit.tv/sn.xml" podcast security twit) + ("https://feeds.fireside.fm/linuxunplugged/rss" podcast linux) + ("https://latenightlinux.com/feed/all" podcast linux) + + ("https://www.youtube.com/feeds/videos.xml?channel_id=UCbgBDBrwsikmtoLqtpc59Bw" youtube tech) ;; teaching tech + ("https://www.youtube.com/feeds/videos.xml?channel_id=UCBJycsmduvYEL83R_U4JriQ" youtube tech) ;; mkbhd + ("https://www.youtube.com/feeds/videos.xml?channel_id=UCUHW94eEFW7hkUMVaZz4eDg" youtube science) ;; minute physics + ("https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA" youtube commentary) ;; luke smith + ("https://www.youtube.com/feeds/videos.xml?channel_id=UCUQo7nzH1sXVpzL92VesANw" youtube diy) ;; DIY perks + ("https://www.youtube.com/feeds/videos.xml?channel_id=UCzgkOWKcwy0uhYilE6bd1Lg" youtube emacs) ;; Zaiste Programming + ("https://www.youtube.com/feeds/videos.xml?channel_id=UCtI0Hodo5o5dUb67FeUjDeA" youtube science tech) ;; SpaceX + + ("http://www.reddit.com/r/emacs/.rss" emacs) + + ("http://telescoper.wordpress.com/feed/" daily) + ("http://xkcd.com/rss.xml" daily) + ("http://pragmaticemacs.com/feed/" emacs) + ("http://endlessparentheses.com/atom.xml" emacs) + ("http://feeds.feedburner.com/XahsEmacsBlog" emacs) + ("http://emacs.stackexchange.com/feeds" emacs) + )) + :config + (defun yt-dl-it (url) + "Downloads the URL in an async shell" + (let ((default-directory "/mnt/c/Users/Levi/Videos")) + (async-shell-command (format "youtube-dl %s" url)))) + + (defun elfeed-youtube-dl (&optional use-generic-p) + "Youtube-DL link" + (interactive "P") + (let ((entries (elfeed-search-selected))) + (cl-loop for entry in entries + do (elfeed-untag entry 'unread) + when (elfeed-entry-link entry) + do (yt-dl-it it)) + (mapc #'elfeed-search-update-entry entries) + (unless (use-region-p) (forward-line)))) + + (define-key elfeed-search-mode-map (kbd "d") 'elfeed-youtube-dl) + (elfeed-update)) + +(provide 'setup-elfeed)