/.dotfiles

My personal dotfiles

Primary LanguageEmacs Lisp

System Config

[Tangle All Configs]

Config Index

Preparation

We first need to load the current colorscheme. The current_colorscheme file is a symlink to the actual colorscheme file. If not present, a random colorscheme is picked.

(when (not (file-exists-p "~/.config/current_colorscheme"))
  (let* ((colorschemes (directory-files (file-name-concat dotfiles-path "assets/colorschemes/") t "\\.el$"))
         (colorscheme-index (random (length colorschemes)))
         (colorscheme-path (nth colorscheme-index colorschemes)))
    (call-process-shell-command
     (concat "ln -s " colorscheme-path " ~/.config/current_colorscheme"))))
(load "~/.config/current_colorscheme" 'nomessage)

Now we add all of the helper functions to the library of babel.

(org-babel-lob-ingest "./functions.org")

Tangle Files

Each config file gets tangled and placed in their respective directories.

(let (org-confirm-babel-evaluate)
  (dolist (config
           (directory-files (file-name-concat dotfiles-path "configs") t "\\.org$"))
    (let (inhibit-message)
      (message "Tangling %s..." (file-name-base config)))
    (org-babel-tangle-file config))
  (let (inhibit-message)
    (message "Done!")))