Browse Source

Cleanup writing module

main
parent
commit
fb77c5ada3
  1. 177
      README.org
  2. 1
      modules/desktop.el
  3. 124
      modules/writing.el

177
README.org

@ -598,7 +598,7 @@ exec dbus-launch --exit-with-session emacs -mm --debug-init
#+ATTR_LATEX: :width 420px
[[./docs/images/2021-02-13-example-mu4e.gif]]
Plain text email delivered via mu, mu4e and mbsync. I run my own email server, so your configuration may differ from mine. This is the ~mbsyncrc~ file I use to synchronize my local mail with my server. This is required for mu4e in Emacs.
Plain text email delivered via mu, mu4e and mbsync. I run my own email server, so your configuration may differ from mine. This is the ~mbsyncrc~ file I use to synchronize my local mail with my server.
#+begin_src conf :tangle config/mbsyncrc
IMAPStore xyz-remote
@ -628,7 +628,7 @@ mbsync -a
mu index --maildir="~/.cache/mail"
#+end_src
Once the mail is being synchronized, and the mail has been indexed with =mu=, it's time to install the required packages for Emacs.
Once the mail's synchronized, and has indexed with =mu=, it's time to install the required packages for Emacs.
+ Update every 5 minutes
+ Scale text for all devices
@ -694,7 +694,7 @@ Write out the ~$BROWSER~ environment variable.
*** Startup
When launching into a session, if the display server is not running then =startx= should be invoked, to run the window manager.
When launching into a session, if the display server is not running then =startx= executes to run the window manager.
#+begin_src sh :tangle config/profile
if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
@ -713,7 +713,7 @@ Define a method to run an external process, allowing us to launch any applicatio
(start-process-shell-command command nil command))
#+end_src
Some methods must be called and applied to the current call process in order to function correctly with Emacs hooks.
Apply methods to the current call process to avoid issues with hooks.
#+begin_src emacs-lisp
(defun dotfiles/run-in-background (command)
@ -735,7 +735,7 @@ Place keybindings for executing shell commands behind =SPC x=.
*** Displays
When the window manager first launches the ~init-hook~ will be called, this allows us to define some custom logic when it's initialized.
When the window manager first launches the ~init-hook~ executes, allowing us to define some custom logic.
+ Display time and date
+ Display battery info (if available)
@ -759,7 +759,7 @@ Using =autorandr= with pre configured profiles, switching screens (AKA hot plugg
*** Configuration
Connect our custom hooks and configure the input keys, a custom layer for defining which keys are captured by Emacs, and which are passed through to =X= applications.
Connect our custom hooks and configure the input keys, a custom layer for key capture layers.
+ Enable =randr= support
+ Pass through to Emacs
@ -773,7 +773,6 @@ Using =autorandr= with pre configured profiles, switching screens (AKA hot plugg
#+begin_src emacs-lisp
(use-package exwm
:demand t
:custom (exwm-workspace-show-all-buffers t)
(exwm-input-prefix-keys
'(?\M-x
@ -816,74 +815,14 @@ I am using [[https://orgmode.org][org-mode]] extensively for writing projects fo
#+ATTR_LATEX: :width 420px
[[./docs/images/2021-02-13-example-roam.png]]
Download and install [[https://orgroam.com][org-roam]], a plain text knowledge management system for Emacs. Organize the capture templates, this allows me to quickly dictate where each new item should be placed.
+ ~posts/~ contains blog posts
+ ~notes/~ contains cited notes on others' work
+ ~slides/~ contains presentations / screencasts
Download and install [[https://orgroam.com][org-roam]], a plain text knowledge management system for Emacs.
#+begin_src emacs-lisp
(use-package org-roam
:hook (after-init . org-roam-mode)
:custom (org-roam-directory org-directory)
(org-roam-encrypt-files t)
(org-roam-capture-templates
'(("p" "Post" plain (function org-roam-capture--get-point)
"%?"
:file-name "docs/posts/${slug}"
:unnarrowed t
:head
"
,#+TITLE: ${title}
,#+AUTHOR: Christopher James Hayward
,#+DATE: %<%Y-%m-%d>
,#+EXPORT_FILE_NAME: ${slug}
,#+ROAM_KEY: https://chrishayward.xyz/posts/${slug}/
,#+HUGO_BASE_DIR: ../
,#+HUGO_AUTO_SET_LASTMOD: t
,#+HUGO_SECTION: posts
,#+HUGO_DRAFT: true
")
("n" "Notes" plain (function org-roam-capture--get-point)
"%?"
:file-name "docs/notes/${slug}"
:unnarrowed t
:head
"
,#+TITLE: ${title}
,#+AUTHOR: Christopher James Hayward
,#+EXPORT_FILE_NAME: ${slug}
,#+ROAM_KEY: https://chrishayward.xyz/notes/${slug}/
,#+HUGO_BASE_DIR: ../
,#+HUGO_AUTO_SET_LASTMOD: t
,#+HUGO_SECTION: notes
,#+HUGO_DRAFT: true
")
("c" "Course" plain (function org-roam-capture--get-point)
"%?"
:file-name "docs/courses/${slug}"
:unnarrowed t
:head
"
,#+TITLE: ${title}
,#+SUBTITLE:
,#+AUTHOR: Christopher James Hayward
")
("s" "Slides" plain (function org-roam-capture--get-point)
"%?"
:file-name "docs/slides/${slug}"
:unnarrowed t
:head
"
,#+TITLE: ${title}
,#+AUTHOR: Christopher James Hayward
,#+REVEAL_ROOT: https://cdn.jsdelivr.net/npm/reveal.js
")))
(org-roam-capture-templates '())
(org-roam-dailies-capture-templates
'(("d" "Default" entry (function org-roam-capture--get-point)
"* %?"
@ -926,23 +865,94 @@ Visualize the org-roam database with the server, available when the editor is ru
*** Hugo
I use [[https://gohugo.io][Hugo]] for my personal [[https://chrishayward.xyz][website]], which I write in =Org-mode= before compiling to =hugo-markdown=. [[https://github.com/kaushalmodi/ox-hugo][Ox-hugo]], configured for =one-post-per-file= is my technique for managing my blog.
I use [[https://gohugo.io][Hugo]] for my personal [[https://chrishayward.xyz][website]], which I write in =org-mode= before compiling to =hugo-markdown=. [[https://github.com/kaushalmodi/ox-hugo][ox-hugo]], configured for =one-post-per-file= is my technique for managing my content.
#+begin_src emacs-lisp
(use-package ox-hugo
:after ox)
#+end_src
*** Posts
Add a capture template for creatinhg new blog posts.
#+begin_src emacs-lisp
(with-eval-after-load 'org-roam
(add-to-list 'org-roam-capture-templates
'("p" "Post" plain (function org-roam-capture--get-point)
"%?"
:file-name "docs/posts/${slug}"
:unnarrowed t
:head
"
,#+TITLE: ${title}
,#+AUTHOR: Christopher James Hayward
,#+DATE: %<%Y-%m-%d>
,#+EXPORT_FILE_NAME: ${slug}
,#+ROAM_KEY: https://chrishayward.xyz/posts/${slug}/
,#+HUGO_BASE_DIR: ../
,#+HUGO_AUTO_SET_LASTMOD: t
,#+HUGO_SECTION: posts
,#+HUGO_DRAFT: true
")))
#+end_src
*** Notes
Add a capture template for creating blog posts and notes on other peoples content / published works.
#+begin_src emacs-lisp
(with-eval-after-load 'org-roam
(add-to-list 'org-roam-capture-templates
'("n" "Notes" plain (function org-roam-capture--get-point)
"%?"
:file-name "docs/notes/${slug}"
:unnarrowed t
:head
"
,#+TITLE: ${title}
,#+AUTHOR: Christopher James Hayward
,#+EXPORT_FILE_NAME: ${slug}
,#+ROAM_KEY: https://chrishayward.xyz/notes/${slug}/
,#+HUGO_BASE_DIR: ../
,#+HUGO_AUTO_SET_LASTMOD: t
,#+HUGO_SECTION: notes
,#+HUGO_DRAFT: true
")))
#+end_src
*** Slides
Produce high quality presentations that work anywhere with =HTML/JS= and the [[https://revealjs.com][Reveal.js]] package. [[https://github.com/hexmode/ox-reveal][Ox-reveal]], configured to use a =cdn= allows us to produce ones that are not dependent on a local version of =Reveal.js=.
Produce high quality presentations that work anywhere with =HTML/JS= and the [[https://revealjs.com][reveal.js]] package. [[https://github.com/hexmode/ox-reveal][ox-reveal]], configured to use a =cdn= allows us to produce ones that are not dependent on a local version of =reveal.js=.
#+begin_src emacs-lisp
(use-package ox-reveal
:after ox
:after ox-roam
:custom (org-reveal-root "https://cdn.jsdelivr.net/npm/reveal.js"))
#+end_src
Create a capture template for creating slides quickly, with our desired configuration.
#+begin_src emacs-lisp
(with-eval-after-load 'org-roam
(add-to-list 'org-roam-capture-templates
'("s" "Slides" plain (function org-roam-capture--get-point)
"%?"
:file-name "docs/slides/${slug}"
:unnarrowed t
:head
"
,#+TITLE: ${title}
,#+AUTHOR: Christopher James Hayward
,#+REVEAL_ROOT: https://cdn.jsdelivr.net/npm/reveal.js
")))
#+end_src
*** Agenda
#+ATTR_ORG: :width 420px
@ -959,6 +969,23 @@ Override ~org-agenda-file-regexp~ to include =.org.gpg= files.
org-agenda-file-regexp)))
#+end_src
Create a capture template for courses.
#+begin_src emacs-lisp
(with-eval-after-load 'org-roam
(add-to-list 'org-roam-capture-templates
'("c" "Course" plain (function org-roam-capture--get-point)
"%?"
:file-name "docs/courses/${slug}"
:unnarrowed t
:head
"
,#+TITLE: ${title}
,#+SUBTITLE:
,#+AUTHOR: Christopher James Hayward
")))
#+end_src
Configure agenda sources.
#+begin_src emacs-lisp
@ -978,9 +1005,9 @@ Open an agenda buffer with =SPC a=.
Create screencasts with =one-frame-per-action= GIF recording via [[https://github.com/takaxp/emacs-gif-screencast][emacs-gif-screencast]].
+ Can be paused / resumed
+ High quality images
+ Optimized size
+ Pause / Resume
+ High Quality
+ Optimized
It requires the installation of ~scrot~, ~gifsicle~, and ~convert~ from the =ImageMagick= library.

1
modules/desktop.el

@ -63,7 +63,6 @@
(dotfiles/run-in-background "autorandr --change --force"))
(use-package exwm
:demand t
:custom (exwm-workspace-show-all-buffers t)
(exwm-input-prefix-keys
'(?\M-x

124
modules/writing.el

@ -6,13 +6,41 @@
:hook (after-init . org-roam-mode)
:custom (org-roam-directory org-directory)
(org-roam-encrypt-files t)
(org-roam-capture-templates
'(("p" "Post" plain (function org-roam-capture--get-point)
"%?"
:file-name "docs/posts/${slug}"
:unnarrowed t
(org-roam-capture-templates '())
(org-roam-dailies-capture-templates
'(("d" "Default" entry (function org-roam-capture--get-point)
"* %?"
:file-name "docs/daily/%<%Y-%m-%d>"
:head
"
#+TITLE: %<%Y-%m-%d>
#+AUTHOR: Christopher James Hayward
"))))
(dotfiles/leader
"r" '(:ignore t :which-key "Roam")
"rf" '(org-roam-find-file :which-key "Find")
"rb" '(org-roam-buffer-toggle-display :which-key "Buffer")
"rd" '(:ignore t :which-key "Dailies")
"rdd" '(org-roam-dailies-find-date :which-key "Date")
"rdt" '(org-roam-dailies-find-today :which-key "Today")
"rdm" '(org-roam-dailies-find-tomorrow :which-key "Tomorrow")
"rdy" '(org-roam-dailies-find-yesterday :which-key "Yesterday"))
(use-package org-roam-server
:hook (org-roam-mode . org-roam-server-mode))
(use-package ox-hugo
:after ox)
(with-eval-after-load 'org-roam
(add-to-list 'org-roam-capture-templates
'("p" "Post" plain (function org-roam-capture--get-point)
"%?"
:file-name "docs/posts/${slug}"
:unnarrowed t
:head
"
#+TITLE: ${title}
#+AUTHOR: Christopher James Hayward
#+DATE: %<%Y-%m-%d>
@ -24,12 +52,15 @@
#+HUGO_AUTO_SET_LASTMOD: t
#+HUGO_SECTION: posts
#+HUGO_DRAFT: true
")
("n" "Notes" plain (function org-roam-capture--get-point)
"%?"
:file-name "docs/notes/${slug}"
:unnarrowed t
:head
")))
(with-eval-after-load 'org-roam
(add-to-list 'org-roam-capture-templates
'("n" "Notes" plain (function org-roam-capture--get-point)
"%?"
:file-name "docs/notes/${slug}"
:unnarrowed t
:head
"
#+TITLE: ${title}
#+AUTHOR: Christopher James Hayward
@ -41,63 +72,44 @@
#+HUGO_AUTO_SET_LASTMOD: t
#+HUGO_SECTION: notes
#+HUGO_DRAFT: true
")
("c" "Course" plain (function org-roam-capture--get-point)
"%?"
:file-name "docs/courses/${slug}"
:unnarrowed t
:head
"
#+TITLE: ${title}
#+SUBTITLE:
#+AUTHOR: Christopher James Hayward
")
("s" "Slides" plain (function org-roam-capture--get-point)
"%?"
:file-name "docs/slides/${slug}"
:unnarrowed t
:head
")))
(use-package ox-reveal
:after ox-roam
:custom (org-reveal-root "https://cdn.jsdelivr.net/npm/reveal.js"))
(with-eval-after-load 'org-roam
(add-to-list 'org-roam-capture-templates
'("s" "Slides" plain (function org-roam-capture--get-point)
"%?"
:file-name "docs/slides/${slug}"
:unnarrowed t
:head
"
#+TITLE: ${title}
#+AUTHOR: Christopher James Hayward
#+REVEAL_ROOT: https://cdn.jsdelivr.net/npm/reveal.js
")))
(org-roam-dailies-capture-templates
'(("d" "Default" entry (function org-roam-capture--get-point)
"* %?"
:file-name "docs/daily/%<%Y-%m-%d>"
:head
"
#+TITLE: %<%Y-%m-%d>
#+AUTHOR: Christopher James Hayward
"))))
(dotfiles/leader
"r" '(:ignore t :which-key "Roam")
"rf" '(org-roam-find-file :which-key "Find")
"rb" '(org-roam-buffer-toggle-display :which-key "Buffer")
"rd" '(:ignore t :which-key "Dailies")
"rdd" '(org-roam-dailies-find-date :which-key "Date")
"rdt" '(org-roam-dailies-find-today :which-key "Today")
"rdm" '(org-roam-dailies-find-tomorrow :which-key "Tomorrow")
"rdy" '(org-roam-dailies-find-yesterday :which-key "Yesterday"))
(use-package org-roam-server
:hook (org-roam-mode . org-roam-server-mode))
(use-package ox-hugo
:after ox)
(use-package ox-reveal
:after ox
:custom (org-reveal-root "https://cdn.jsdelivr.net/npm/reveal.js"))
(unless (string-match-p "\\.gpg" org-agenda-file-regexp)
(setq org-agenda-file-regexp
(replace-regexp-in-string "\\\\\\.org" "\\\\.org\\\\(\\\\.gpg\\\\)?"
org-agenda-file-regexp)))
(with-eval-after-load 'org-roam
(add-to-list 'org-roam-capture-templates
'("c" "Course" plain (function org-roam-capture--get-point)
"%?"
:file-name "docs/courses/${slug}"
:unnarrowed t
:head
"
#+TITLE: ${title}
#+SUBTITLE:
#+AUTHOR: Christopher James Hayward
")))
(setq org-agenda-files '("~/.emacs.d/docs/"
"~/.emacs.d/docs/courses/"
"~/.emacs.d/docs/daily/"))

Loading…
Cancel
Save