Browse Source

Update README

main
parent
commit
41caa76cd9
  1. 224
      README.org

224
README.org

@ -40,6 +40,23 @@ Launch emacs: ~emacs -mm --debug-init~
Here's a complete list of all of the options configurable for each host, and their default values. If a host configuration does not exist, these values will be used in place. Here's a complete list of all of the options configurable for each host, and their default values. If a host configuration does not exist, these values will be used in place.
Configure the system font with a single ~font-family~ and define the size, of which variations to the font size are relative to this value.
#+begin_src emacs-lisp
(defvar dotfiles/font
"Fira Code"
"Unified system font family, used on all font faces.")
#+end_src
#+begin_src emacs-lisp
(defvar dotfiles/font-size
96
"Unified font size, of which all variations are relative to.")
#+end_src
Used by the desktop module to find the appropriate browser.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defvar dotfiles/browser (defvar dotfiles/browser
(getenv "BROWSER") (getenv "BROWSER")
@ -288,7 +305,6 @@ Emacs' default user interface is horrendous, but with less than 10 lines of code
(add-to-list 'org-structure-template-alist '("sh" . "src shell")) (add-to-list 'org-structure-template-alist '("sh" . "src shell"))
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
(org-babel-do-load-languages 'org-babel-load-languages '((shell . t) (org-babel-do-load-languages 'org-babel-load-languages '((shell . t)
(python . t)
(emacs-lisp . t)))) (emacs-lisp . t))))
#+end_src #+end_src
@ -536,18 +552,108 @@ Open a dired buffer with =SPC d=.
I use Emacs as a Desktop Environment with the [[https://github.com/ch11ng/exwm][exwm]] package. It allows Emacs to function as a complete tiling window manager for =X11=. My workflow includes launching the window manager with =xinitrc=, without the use of a display manager, controlling *everything* within Emacs. I use Emacs as a Desktop Environment with the [[https://github.com/ch11ng/exwm][exwm]] package. It allows Emacs to function as a complete tiling window manager for =X11=. My workflow includes launching the window manager with =xinitrc=, without the use of a display manager, controlling *everything* within Emacs.
Make sure the browser is available by writing to the ~$BROWSER~ environment variable with our own.
#+begin_src conf :tangle config/xinitrc
exec dbus-launch --exit-with-session emacs -mm --debug-init
#+end_src
*** Email
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.
#+begin_src conf :tangle config/mbsyncrc
IMAPStore xyz-remote
Host mail.chrishayward.xyz
User chris@chrishayward.xyz
PassCmd "pass chrishayward.xyz/chris"
SSLType IMAPS
MaildirStore xyz-local
Path ~/.cache/mail/
Inbox ~/.cache/mail/inbox
SubFolders Verbatim
Channel xyz
Master :xyz-remote:
Slave :xyz-local:
Patterns * !Archives
Create Both
Expunge Both
SyncState *
#+end_src
The system typically expects to find this file at ~$HOME/.mbsyncrc~, but you may also specify a custom path if launching the command using arguments. I chose to symlink the default location to my repository.
#+begin_src shell :tangle no
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.
+ Update every 5 minutes
+ Scale text for all devices
+ Sign outbound mail with GPG key
+ Configure mail account(s)
#+begin_src emacs-lisp
(use-package mu4e
:load-path "/usr/share/emacs/site-lisp/mu4e"
:custom (mu4e-maildir "~/.cache/mail")
(mu4e-update-interval (* 5 60))
(mu4e-get-mail-command "mbsync -a")
(mu4e-compose-format-flowed t)
(mu4e-change-filenames-when-moving t)
(message-send-mail-function 'smtpmail-send-it)
(mml-secure-openpgp-signers '("37AB1CB72B741E478CA026D43025DCBD46F81C0F"))
(mu4e-compose-signature (concat "Chris Hayward\n"
"https://chrishayward.xyz\n"))
:config
(add-hook 'message-send-hook 'mml-secure-message-sign-pgpmime)
(setq mu4e-contexts
(list
;; Main
;; chris@chrishayward.xyz
(make-mu4e-context
:name "Main"
:match-func
(lambda (msg)
(when msg
(string-prefix-p "/Main" (mu4e-message-field msg :maildir))))
:vars
'((user-full-name . "Christopher James Hayward")
(user-mail-address . "chris@chrishayward.xyz")
(smtpmail-smtp-server . "mail.chrishayward.xyz")
(smtpmail-smtp-service . 587)
(smtpmail-stream-type . starttls))))))
#+end_src
Use [[https://github.com/iqbalansari/mu4e-alert][mu4e-alert]] to give us desktop notifications about incoming mail.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setenv "BROWSER" dotfiles/browser)
(use-package mu4e-alert
:custom (mu4e-alert-set-default-style 'libnotify)
:config (mu4e-alert-enable-notifications)
(mu4e-alert-enable-mode-line-display))
#+end_src #+end_src
*** Startup
Create a keybinding to open the mail dashboard with =SPC m=.
#+begin_src conf :tangle config/xinitrc
exec dbus-launch --exit-with-session emacs -mm --debug-init
#+begin_src emacs-lisp
(dotfiles/leader
"m" '(mu4e :which-key "Mail"))
#+end_src #+end_src
*** Browser
Launch a browser with =SPC b=.
#+begin_src emacs-lisp
(dotfiles/leader
"b" '(dotfiles/run-in-background dotfiles/browser :which-key "Browser"))
#+end_src
*** 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= should be invoked, to run the window manager.
#+begin_src sh :tangle config/profile #+begin_src sh :tangle config/profile
@ -556,7 +662,7 @@ if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
fi fi
#+end_src #+end_src
*** Applications
*** Methods
Define a method to run an external process, allowing us to launch any application on a new process without interferring with Emacs. Define a method to run an external process, allowing us to launch any application on a new process without interferring with Emacs.
@ -584,7 +690,7 @@ Some methods must be called and applied to the current call process in order to
"z" '(async-shell-command :which-key "Async")) "z" '(async-shell-command :which-key "Async"))
#+end_src #+end_src
*** Initialization
*** 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~ will be called, this allows us to define some custom logic when it's initialized.
@ -601,8 +707,6 @@ In my personal configuration, I do not want the battery or time displayed within
(display-time-mode 1)) (display-time-mode 1))
#+end_src #+end_src
*** Displays
Using =autorandr= with pre configured profiles, switching screens (AKA hot plugging) is also handled through a hook. Using =autorandr= with pre configured profiles, switching screens (AKA hot plugging) is also handled through a hook.
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -612,17 +716,13 @@ Using =autorandr= with pre configured profiles, switching screens (AKA hot plugg
*** Configuration *** Configuration
Finally we configure the window manager.
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.
+ Enable =randr= support + Enable =randr= support
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.
+ Pass through to Emacs + Pass through to Emacs
+ =M-x= to Emacs + =M-x= to Emacs
+ =C-g= to Emacs + =C-g= to Emacs
+ =C-SPC= to Emacs + =C-SPC= to Emacs
+ Bindings with =S= (Super / Win) + Bindings with =S= (Super / Win)
+ Reset =S-r= + Reset =S-r=
+ Launch =S-&= + Launch =S-&=
@ -787,93 +887,6 @@ By default I want my daily notes to live in ~daily/~ relative to my dotfiles.
"))) ")))
#+end_src #+end_src
*** Email
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.
#+begin_src conf :tangle config/mbsyncrc
IMAPStore xyz-remote
Host mail.chrishayward.xyz
User chris@chrishayward.xyz
PassCmd "pass chrishayward.xyz/chris"
SSLType IMAPS
MaildirStore xyz-local
Path ~/.cache/mail/
Inbox ~/.cache/mail/inbox
SubFolders Verbatim
Channel xyz
Master :xyz-remote:
Slave :xyz-local:
Patterns * !Archives
Create Both
Expunge Both
SyncState *
#+end_src
The system typically expects to find this file at ~$HOME/.mbsyncrc~, but you may also specify a custom path if launching the command using arguments. I chose to symlink the default location to my repository.
#+begin_src shell :tangle no
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.
+ Update every 5 minutes
+ Scale text for all devices
+ Sign outbound mail with GPG key
+ Configure mail account(s)
#+begin_src emacs-lisp
(use-package mu4e
:load-path "/usr/share/emacs/site-lisp/mu4e"
:custom (mu4e-maildir "~/.cache/mail")
(mu4e-update-interval (* 5 60))
(mu4e-get-mail-command "mbsync -a")
(mu4e-compose-format-flowed t)
(mu4e-change-filenames-when-moving t)
(message-send-mail-function 'smtpmail-send-it)
(mml-secure-openpgp-signers '("37AB1CB72B741E478CA026D43025DCBD46F81C0F"))
(mu4e-compose-signature (concat "Chris Hayward\n"
"https://chrishayward.xyz\n"))
:config
(add-hook 'message-send-hook 'mml-secure-message-sign-pgpmime)
(setq mu4e-contexts
(list
;; Main
;; chris@chrishayward.xyz
(make-mu4e-context
:name "Main"
:match-func
(lambda (msg)
(when msg
(string-prefix-p "/Main" (mu4e-message-field msg :maildir))))
:vars
'((user-full-name . "Christopher James Hayward")
(user-mail-address . "chris@chrishayward.xyz")
(smtpmail-smtp-server . "mail.chrishayward.xyz")
(smtpmail-smtp-service . 587)
(smtpmail-stream-type . starttls))))))
#+end_src
Use [[https://github.com/iqbalansari/mu4e-alert][mu4e-alert]] to give us desktop notifications about incoming mail.
#+begin_src emacs-lisp
(use-package mu4e-alert
:custom (mu4e-alert-set-default-style 'libnotify)
:config (mu4e-alert-enable-notifications)
(mu4e-alert-enable-mode-line-display))
#+end_src
Create a keybinding to open the mail dashboard with =SPC m=.
#+begin_src emacs-lisp
(dotfiles/leader
"m" '(mu4e :which-key "Mail"))
#+end_src
*** Agenda *** Agenda
Override ~org-agenda-file-regexp~ to include =.org.gpg= files. Override ~org-agenda-file-regexp~ to include =.org.gpg= files.
@ -1129,13 +1142,6 @@ Add a golang source code block structure template with ~<go~:
*** Fonts *** Fonts
Configure the system font with a single ~font-family~ and define the size, of which variations to the font size are relative to this value.
#+begin_src emacs-lisp
(defvar dotfiles/font "Fira Code")
(defvar dotfiles/font-size 96)
#+end_src
Write out to all *3* of Emacs' default font faces. Write out to all *3* of Emacs' default font faces.
#+begin_src emacs-lisp #+begin_src emacs-lisp

Loading…
Cancel
Save