From f4050f23d6a6e27ea180e96447f0437d1e99cfdd Mon Sep 17 00:00:00 2001 From: Phil Bajsicki Date: Thu, 3 Oct 2024 00:41:07 +0200 Subject: [PATCH] Update [2024-10-03 Thu 00:41] --- .config/doom/README.el | 1 - .config/doom/README.org | 169 +++++++++++++++++++++++--------------- .config/doom/config | 6 -- .config/doom/config.el | 99 +++++++++++++--------- .config/doom/init.el | 2 +- .config/doom/packages.el | 1 + .config/doom/packages.el~ | 62 ++++++++++++++ .config/xmonad/README.org | 17 ++-- .config/xmonad/xmonad.hs | 7 +- 9 files changed, 244 insertions(+), 120 deletions(-) delete mode 100644 .config/doom/README.el delete mode 100644 .config/doom/config create mode 100644 .config/doom/packages.el~ diff --git a/.config/doom/README.el b/.config/doom/README.el deleted file mode 100644 index 8b13789..0000000 --- a/.config/doom/README.el +++ /dev/null @@ -1 +0,0 @@ - diff --git a/.config/doom/README.org b/.config/doom/README.org index f574b4f..8f8c83d 100644 --- a/.config/doom/README.org +++ b/.config/doom/README.org @@ -1,5 +1,6 @@ -#+Title: Phil's Doom Emacs Config -#+STARTUP: indent +#+Title: Phil's Doom Emacs Literate Config +#+author: Phil Bajsicki +#+STARTUP: indent show2levels #+auto_tangle: t * Intro @@ -14,7 +15,18 @@ Some of the comments are from the default config.el file that ships with Doom Em You can extract all the source/ config files from here by running Emacs and hitting ~C-c C-v t~. A lot of these are swiped from [[https://gitlab.com/dwt1/configuring-emacs/][DT's Configuring Emacs config files]], as well as [[https://github.com/novoid/dot-emacs][Karl Voit's Emacs config.]] +* Header +:PROPERTIES: +:CREATED: <2024-09-23 Mon 01:07> +:END: +This will generate a header, clarifying that the resulting Doom Emacs ~config.el~ is not to be modified directly. +#+begin_src elisp :tangle config.el +;; -*- lexical-binding: t -*- +;; DO NOT EDIT THIS FILE +;; This file was generated from the .config/doom/README.org file +;; in the following repo: https://git.bajsicki.com/phil/dot/ +#+end_src * config.el ** Basic settings *** Author/ personal info @@ -211,6 +223,12 @@ Keeps images contained on the screen. (setq org-image-actual-width '(0.8)) #+end_src +Footnote positioning and style. +#+begin_src elisp :tangle config.el +(setq org-footnote-auto-adjust t) +(setq org-footnote-define-inline t) +#+end_src + Pretty! #+begin_src emacs-lisp config.el (setq org-superstar-headline-bullets-list @@ -377,21 +395,6 @@ Change font for DONE tasks ((((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon" :strike-through t))))) #+END_SRC -**** Keybinds -Pretty self-explanatory. -#+begin_src emacs-lisp :tangle config.el -(global-set-key "\C-cl" 'org-store-link) -(global-set-key "\C-cnn" 'org-capture) -#+end_src -***** Timestamp keybinds -Inserts timestamps in the proper format. ~'(16)~ stands for two universal arguments, keeping the command from prompting for the time. Two keybinds here, which insert an active or inactive timestamp. -#+begin_src emacs-lisp :tangle config.el -(global-set-key "\C-cia" '(lambda ()(interactive) - (org-time-stamp '(16)))) -(global-set-key "\C-cii" '(lambda () (interactive) - (org-time-stamp-inactive '(16)))) -#+end_src - **** Capture templates #+begin_src emacs-lisp :tangle config.el @@ -418,6 +421,53 @@ Inserts timestamps in the proper format. ~'(16)~ stands for two universal argume | i | idea | entry | (file+headline ~/enc/org/agenda.org Ideas) | * %? | | d | reminder | entry | (file+headline ~/enc/org/agenda.org Reminders) | * %i%? | +**** Keybinds +Pretty self-explanatory. +#+begin_src emacs-lisp :tangle config.el +(global-set-key "\C-cl" 'org-store-link) +(global-set-key "\C-cnn" 'org-capture) +#+end_src +***** Timestamp keybinds +Inserts timestamps in the proper format. ~'(16)~ stands for two universal arguments, keeping the command from prompting for the time. Two keybinds here, which insert an active or inactive timestamp. +#+begin_src emacs-lisp :tangle config.el +(global-set-key "\C-cia" '(lambda ()(interactive) + (org-time-stamp '(16)))) +(global-set-key "\C-cii" '(lambda () (interactive) + (org-time-stamp-inactive '(16)))) +#+end_src + +**** org-roam +#+begin_src emacs-lisp :tangle config.el +(setq org-roam-v2-ack t) +(setq org-roam-completion-everywhere t) +(setq org-roam-directory + (file-truename "~/enc/org/roam")) +(org-roam-db-autosync-mode) +(org-roam-db-autosync-enable) +#+end_src +***** Capture templates +#+begin_src emacs-lisp :tangle config.el +(setq org-roam-capture-templates + '(("n" "default" plain + "%?" + :if-new (file+head "${slug}.org" "#+title: ${title}\n#+category: ${title}\n#+filetags: \n") + :empty-lines 1 + :unnarrowed t) + ("t" "Therapy" plain + "#+title: ${title}\n" + :if-new (file+head "therapy/therapy-${slug}.org" "#+title: ${title}\n#+category: 📗 ${title}\n#+filetags: 📗\n") + :empty-lines 1 + :unnarrowed))) +#+end_src +***** Keybinds +#+begin_src emacs-lisp :tangle config.el +(define-prefix-command 'org-roam-map) +(global-set-key "\C-r" 'org-roam-map) +(define-key org-roam-map "o" 'org-roam-buffer-toggle) +(define-key org-roam-map "f" 'org-roam-node-find) +(define-key org-roam-map "i" 'org-roam-node-insert) +(define-key org-roam-map "n" 'org-roam-capture) +#+end_src **** Functions ***** my-id-get-or-generate Straight from Karl Voit's config. @@ -653,41 +703,6 @@ This results in a list that gets added to the Org-mode buffer similar to: (select-window dired-win))) #+end_src -**** org-roam -#+begin_src emacs-lisp :tangle config.el -(setq org-roam-v2-ack t) -(setq org-roam-completion-everywhere t) -(setq org-roam-directory - (file-truename "~/enc/org/roam")) -(org-roam-db-autosync-mode) -(org-roam-db-autosync-enable) - -(setq org-roam-capture-templates - '(("n" "default" plain - "%?" - :if-new (file+head "${slug}.org" "#+title: ${title}\n#+category: ${title}\n#+filetags: \n") - :empty-lines 1 - :unnarrowed t) - ("t" "Therapy" plain - "#+title: ${title}\n" - :if-new (file+head "therapy/therapy-${slug}.org" "#+title: ${title}\n#+category: 📗 ${title}\n#+filetags: 📗\n") - :empty-lines 1 - :unnarrowed))) -#+end_src - -***** Keybinds -#+begin_src emacs-lisp :tangle config.el -(define-prefix-command 'org-roam-map) -(global-set-key "\C-r" 'org-roam-map) -(define-key org-roam-map "o" 'org-roam-buffer-toggle) -(define-key org-roam-map "f" 'org-roam-node-find) -(define-key org-roam-map "i" 'org-roam-node-insert) -(define-key org-roam-map "n" 'org-roam-capture) -#+end_src - -#+RESULTS: -: org-roam-capture - **** org-agenda These are settings specifically for org-agenda, that don't overlap with any other settings. @@ -829,7 +844,10 @@ For the files whose paths match the strings in the function, it will advise the This turns making new entries from ~C- C-i i~ into just ~C-~. Much easier, and I don't have to think about this any more. +Additionally, outside of the structured files where I am tracking time linearly, I want ~org-expiry-insert-created~, which fits in neatly into this little hook, thus allowing me to inspect my workflows more carefully. + #+begin_src emacs-lisp :tangle config.el +(use-package! org-expiry) (after! org (add-hook! 'org-insert-heading-hook (if (or @@ -838,7 +856,8 @@ This turns making new entries from ~C- C-i i~ into just ~C-~. Mu (string-match-p "therapy.org" buffer-file-name)) (progn (org-time-stamp-inactive '(16)) - (newline))))) + (newline)) + (org-expiry-insert-created)))) #+end_src *** org-mode expansions @@ -860,19 +879,10 @@ key, which I have set up with my NitroKey. It's some really really cool tech. (setq org-crypt-key "phil@bajsicki.com") (setenv "GPG_AGENT_INFO" nil) #+end_src -**** org-expiry -:PROPERTIES: -:CREATED: <2024-09-18 Wed 23:03> -:END: -I want my entries to have a real expiry date sometimes, so this is here. It's -quite neat! I am then hooking it into -#+begin_src emacs-lisp :tangle config.el -(use-package! org-expiry) -#+end_src **** org-export Just a catch-all category for this... I honestly should split things up better instead of this, but it is what it is. -****** LaTeX +***** LaTeX Adding the tufte-handout and the memoir classes. #+begin_src emacs-lisp :tangle config.el (with-eval-after-load 'ox-latex @@ -905,6 +915,15 @@ I have not settled on this. Meh. (setq org-latex-default-class "tufte-handout" org-latex-pdf-process '("latexmk -pdf -bibtex-cond -f -outdir=%o %f")) #+end_src +***** ox-hugo +:PROPERTIES: +:CREATED: <2024-09-24 Tue 15:08> +:END: +#+begin_src elisp :tangle config.el +(use-package! ox-hugo + :ensure t + :after ox) +#+end_src **** org-transclusion I don't use this enough, and hopefully I'll find happiness with this if I do end up working on larger projects. @@ -949,6 +968,25 @@ Email in Emacs... what more can a man want? #+end_src #+RESULTS: +*** circe +:PROPERTIES: +:CREATED: <2024-09-21 Sat 23:50> +:END: +Doesn't work very well. I guess it "works", but I still need to auth manually; not sure what the issue is - my best guess is that my passwords use unusual unicode characters and that screws with the ~(read)~ instruction. +#+begin_src emacs-lisp :tangle config.el +(setq my-credentials-file "~/enc/keys/emacs/circe.el") + +(defun my-nickserv-password (server) + (with-temp-buffer + (insert-file-contents-literally my-credentials-file) + (plist-get (read (buffer-string)) :nickserv-password))) + +(setq circe-network-options + '(("Libera Chat" + :nick "phil_bb" + :channels ("#emacs" "#emacs-circe") + :nickserv-password my-nickserv-password))) +#+end_src *** pdf-tools Gotta read in Emacs, sometimes. Usually in the browser, but when I have to take @@ -1226,7 +1264,7 @@ Custom variables. Note that this file is generally set up automatically by Emacs :app calendar - ;;emms + emms everywhere ; *leave* Emacs!? You must be joking irc ; how neckbeards socialize (rss +org) ; emacs as an RSS reader @@ -1282,6 +1320,7 @@ Custom variables. Note that this file is generally set up automatically by Emacs (package! org-auto-tangle) (package! ox-slack) (package! ox-tufte) +(package! ox-hugo) (package! ox-gemini :recipe ( :host sourcehut @@ -1304,7 +1343,7 @@ Custom variables. Note that this file is generally set up automatically by Emacs (package! org-wild-notifier) (package! org-habit-stats) #+end_src -**** org-expiry +**** org-contrib #+begin_src emacs-lisp :tangle packages.el (package! org-contrib :recipe (:host sourcehut :type git diff --git a/.config/doom/config b/.config/doom/config deleted file mode 100644 index ea6a64c..0000000 --- a/.config/doom/config +++ /dev/null @@ -1,6 +0,0 @@ -(global-unset-key (kbd "C-c l")) -(global-set-key (kbd "C-c l l") 'org-super-links-link) -(global-set-key (kbd "C-c l s") 'org-super-links-store-link) -(global-set-key (kbd "C-c l i") 'org-super-links-insert-drawer-link) -(global-set-key (kbd "C-c l r") 'org-super-links-quick-related) -(global-set-key (kbd "C-c l d") 'org-super-links-delete-link) diff --git a/.config/doom/config.el b/.config/doom/config.el index 834d6e8..2a63f41 100644 --- a/.config/doom/config.el +++ b/.config/doom/config.el @@ -1,3 +1,8 @@ +;; -*- lexical-binding: t -*- +;; DO NOT EDIT THIS FILE +;; This file was generated from the .config/doom/README.org file +;; in the following repo: https://git.bajsicki.com/phil/dot/ + (setq user-full-name "Phil Bajsicki") (setq-default backup-inhibited t) @@ -104,6 +109,9 @@ (setq org-image-actual-width '(0.8)) +(setq org-footnote-auto-adjust t) +(setq org-footnote-define-inline t) + (global-org-modern-mode) (setq org-read-date-prefer-future t) @@ -184,14 +192,6 @@ ((((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon" :strike-through t))))) -(global-set-key "\C-cl" 'org-store-link) -(global-set-key "\C-cnn" 'org-capture) - -(global-set-key "\C-cia" '(lambda ()(interactive) - (org-time-stamp '(16)))) -(global-set-key "\C-cii" '(lambda () (interactive) - (org-time-stamp-inactive '(16)))) - (setq org-capture-templates '(("t" "inbox" entry (file+headline "~/enc/org/agenda.org" "Inbox") "* %i%?") ("i" "idea" entry (file+headline "~/enc/org/agenda.org" "Ideas") "* %?") ("d" "reminder" entry (file+headline "~/enc/org/agenda.org" "Reminders") "* %i%? \n %U") @@ -209,6 +209,40 @@ :BIRTHDAY: :END:"))) +(global-set-key "\C-cl" 'org-store-link) +(global-set-key "\C-cnn" 'org-capture) + +(global-set-key "\C-cia" '(lambda ()(interactive) + (org-time-stamp '(16)))) +(global-set-key "\C-cii" '(lambda () (interactive) + (org-time-stamp-inactive '(16)))) + +(setq org-roam-v2-ack t) +(setq org-roam-completion-everywhere t) +(setq org-roam-directory + (file-truename "~/enc/org/roam")) +(org-roam-db-autosync-mode) +(org-roam-db-autosync-enable) + +(setq org-roam-capture-templates + '(("n" "default" plain + "%?" + :if-new (file+head "${slug}.org" "#+title: ${title}\n#+category: ${title}\n#+filetags: \n") + :empty-lines 1 + :unnarrowed t) + ("t" "Therapy" plain + "#+title: ${title}\n" + :if-new (file+head "therapy/therapy-${slug}.org" "#+title: ${title}\n#+category: 📗 ${title}\n#+filetags: 📗\n") + :empty-lines 1 + :unnarrowed))) + +(define-prefix-command 'org-roam-map) +(global-set-key "\C-r" 'org-roam-map) +(define-key org-roam-map "o" 'org-roam-buffer-toggle) +(define-key org-roam-map "f" 'org-roam-node-find) +(define-key org-roam-map "i" 'org-roam-node-insert) +(define-key org-roam-map "n" 'org-roam-capture) + (defun my-dir-to-org (dir org-file) "Create a file ORG-FILE which has all txt files in DIR as linked headlines and the contents of the files below the headlines." @@ -322,32 +356,6 @@ w (buffer-name (let* ((heading (org-get-heading t t)) (org-end-of-subtree t t) (org-paste-subtree level tree-text)))))))) -(setq org-roam-v2-ack t) -(setq org-roam-completion-everywhere t) -(setq org-roam-directory - (file-truename "~/enc/org/roam")) -(org-roam-db-autosync-mode) -(org-roam-db-autosync-enable) - -(setq org-roam-capture-templates - '(("n" "default" plain - "%?" - :if-new (file+head "${slug}.org" "#+title: ${title}\n#+category: ${title}\n#+filetags: \n") - :empty-lines 1 - :unnarrowed t) - ("t" "Therapy" plain - "#+title: ${title}\n" - :if-new (file+head "therapy/therapy-${slug}.org" "#+title: ${title}\n#+category: 📗 ${title}\n#+filetags: 📗\n") - :empty-lines 1 - :unnarrowed))) - -(define-prefix-command 'org-roam-map) -(global-set-key "\C-r" 'org-roam-map) -(define-key org-roam-map "o" 'org-roam-buffer-toggle) -(define-key org-roam-map "f" 'org-roam-node-find) -(define-key org-roam-map "i" 'org-roam-node-insert) -(define-key org-roam-map "n" 'org-roam-capture) - (setq org-agenda-start-day nil) (setq org-agenda-start-on-weekday nil) (setq org-agenda-span 'day) @@ -411,6 +419,7 @@ w (buffer-name (let* ((heading (org-get-heading t t)) (require 'org-auto-tangle) (add-hook 'org-mode-hook 'org-auto-tangle-mode) +(use-package! org-expiry) (after! org (add-hook! 'org-insert-heading-hook (if (or @@ -419,7 +428,8 @@ w (buffer-name (let* ((heading (org-get-heading t t)) (string-match-p "therapy.org" buffer-file-name)) (progn (org-time-stamp-inactive '(16)) - (newline))))) + (newline)) + (org-expiry-insert-created)))) (add-hook 'org-babel-after-execute-hook 'org-display-inline-images) @@ -431,8 +441,6 @@ w (buffer-name (let* ((heading (org-get-heading t t)) (setq org-crypt-key "phil@bajsicki.com") (setenv "GPG_AGENT_INFO" nil) -(use-package! org-expiry) - (with-eval-after-load 'ox-latex (add-to-list 'org-latex-classes '("tufte-handout" @@ -453,6 +461,10 @@ w (buffer-name (let* ((heading (org-get-heading t t)) ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))) +(use-package! ox-hugo + :ensure t + :after ox) + (use-package! org-transclusion :after org :init @@ -484,6 +496,19 @@ w (buffer-name (let* ((heading (org-get-heading t t)) (mu4e t) +(setq my-credentials-file "~/enc/keys/emacs/circe.el") + +(defun my-nickserv-password (server) + (with-temp-buffer + (insert-file-contents-literally my-credentials-file) + (plist-get (read (buffer-string)) :nickserv-password))) + +(setq circe-network-options + '(("Libera Chat" + :nick "phil_bb" + :channels ("#emacs" "#emacs-circe") + :nickserv-password my-nickserv-password))) + (use-package! pdf-tools :defer t :commands (pdf-loader-install) diff --git a/.config/doom/init.el b/.config/doom/init.el index 83555d9..cea29a0 100644 --- a/.config/doom/init.el +++ b/.config/doom/init.el @@ -182,7 +182,7 @@ :app calendar - ;;emms + emms everywhere ; *leave* Emacs!? You must be joking irc ; how neckbeards socialize (rss +org) ; emacs as an RSS reader diff --git a/.config/doom/packages.el b/.config/doom/packages.el index 51b11f0..ca62079 100644 --- a/.config/doom/packages.el +++ b/.config/doom/packages.el @@ -26,6 +26,7 @@ (package! org-auto-tangle) (package! ox-slack) (package! ox-tufte) +(package! ox-hugo) (package! ox-gemini :recipe ( :host sourcehut diff --git a/.config/doom/packages.el~ b/.config/doom/packages.el~ new file mode 100644 index 0000000..ca62079 --- /dev/null +++ b/.config/doom/packages.el~ @@ -0,0 +1,62 @@ +;; -*- no-byte-compile: t; -*- +;;; $DOOMDIR/packages.el + +(unpin! straight) +(package! beacon) +(package! counsel) +(package! deft) + +(package! all-the-icons) +(package! all-the-icons-dired) +(package! doom-themes) + +(package! battle-haxe) +(package! fish-mode) +(package! typescript-mode) +(package! terraform-mode) +(package! wc-mode) +(package! plantuml-mode) +(package! csv-mode) + +(package! dired-open) + +(package! pdf-tools) + +;; Fix for org-roam link issue +(package! org-auto-tangle) +(package! ox-slack) +(package! ox-tufte) +(package! ox-hugo) +(package! ox-gemini + :recipe ( + :host sourcehut + :repo "abrahms/ox-gemini")) +(package! org-special-block-extras) +(package! org-transclusion) +(package! org-modern) +(package! org-ql) +(package! org-sidebar + :recipe ( + :host github + :repo "alphapapa/org-sidebar" + )) +(package! org-contacts) +(package! org-bullets) +(package! org-download) +(package! org-cliplink) +(package! org-roam) +;; (package! org-super-agenda) +(package! org-wild-notifier) +(package! org-habit-stats) + +(package! org-contrib + :recipe (:host sourcehut :type git + :repo "~bzg/org-contrib" + :files ("lisp/*.el"))) + +(package! gptel + :recipe (:host github + :repo "karthink/gptel" + :files ("*.el"))) + +(package! elpher) diff --git a/.config/xmonad/README.org b/.config/xmonad/README.org index 5212c5e..fd03c16 100644 --- a/.config/xmonad/README.org +++ b/.config/xmonad/README.org @@ -1,7 +1,7 @@ #+title: Phil's xmonad config #+author: Phil Bajsicki #+PROPERTY: header-args :tangle xmonad.hs - +#+auto_tangle: t * Table of Contents :toc: - [[#info][Info]] @@ -562,6 +562,7 @@ Notes: I use a ZSA Moonlander so a lot of the 4-5 key sequences are actually jus , ("M-d", spawn "rofi -show drun") #+end_src *** Some common keybinds: + #+begin_src haskell , ("M-e", spawn "emacsclient -c") , ("M-", spawn "alacritty") @@ -571,18 +572,22 @@ Notes: I use a ZSA Moonlander so a lot of the 4-5 key sequences are actually jus , ("M-S-C-M1-s", spawn "xscreensaver-command -lock") #+end_src -*** Keybindings for keyboard layout changes +*** Keybindings for keyboard layout changes :ATTACH: +:PROPERTIES: +:ID: 5ec9fb1e-82b8-4961-ae4f-5f942c53984f +:END: #+begin_src haskell , ("M-j p", spawn "setxkbmap -model pc104 -layout pl -option compose:rctrl") , ("M-j g", spawn "setxkbmap -model pc104 -layout gr -option compose:rctrl") #+end_src *** XMonad.Prompt.OrgMode +This is one of the most useful things in the world. +Written by [[https://xmonad.github.io/xmonad-docs/xmonad-contrib/XMonad-Prompt-OrgMode.html][Tony Zorman]] (a really nice guy) it's truly a great improvement to my workflow. #+begin_src haskell - , ("M-c i", orgPrompt def "TODO" "~/enc/org/inbox.org") - , ("M-c l", orgPromptPrimary def "LINK" "~/enc/org/inbox.org") - , ("M-c n", orgPrompt def "NOTE" "~/enc/org/inbox.org") - , ("M-c p", orgPromptRefile def "TODO" "~/enc/org/phil.org") + , ("M-c i", orgPromptRefileTo def "INBOX :inbox:" "INBOX" "~/enc/org/inbox.org") + , ("M-c l", orgPromptPrimary def "Unsorted :link:" "~/enc/org/bookmarks.org") + , ("M-c n", orgPromptRefileTo def "NOTE :note:\n" "~/enc/org/.org") #+end_src *** Timestamp chords For local time, EST, and PST. diff --git a/.config/xmonad/xmonad.hs b/.config/xmonad/xmonad.hs index 346c899..e258200 100644 --- a/.config/xmonad/xmonad.hs +++ b/.config/xmonad/xmonad.hs @@ -343,10 +343,9 @@ main = do , ("M-j p", spawn "setxkbmap -model pc104 -layout pl -option compose:rctrl") , ("M-j g", spawn "setxkbmap -model pc104 -layout gr -option compose:rctrl") - , ("M-c i", orgPrompt def "TODO" "~/enc/org/inbox.org") - , ("M-c l", orgPromptPrimary def "LINK" "~/enc/org/inbox.org") - , ("M-c n", orgPrompt def "NOTE" "~/enc/org/inbox.org") - , ("M-c p", orgPromptRefile def "TODO" "~/enc/org/phil.org") + , ("M-c i", orgPromptRefileTo def "INBOX :inbox:" "INBOX" "~/enc/org/inbox.org") + , ("M-c l", orgPromptPrimary def "Unsorted :link:" "~/enc/org/bookmarks.org") + , ("M-c n", orgPromptRefileTo def "NOTE :note:\n" "~/enc/org/.org") -- Time! Timestamps! , ("M-w l", spawn "sleep 0.5 && xdotool type \"$(date +'%Y.%m.%d %H:%M:%S %Z')\"")