Skip to content

My Linux configuration files in a single org-mode document. Features: conditional configuration files, setup with stow, encryption of private information..

Notifications You must be signed in to change notification settings

bottom-bracket/orgmode-linux-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

How it works

This section is the README.org. It’s saved automatically on each save.

stow

tangling in folders

conditional tangling

Define a function that disables export of a code block if the conftype property does not match a certain value. the idea is that the conftype property is set at top level (after pulling to a new device) and it is then respected by the tangle process.

(defun my-tangle-if-property-in-tags (property-name)
  "Create :tangle argument based on a local property value.
Check if the conftype property matches a tag at the current postition.
The tags are searched recursively, so it's recommended to tag
the last subheading level. If it matches return the property
 value of the TANGLE_FILE_NAME or ('yes' by default)
if not return 'no'."
  (if (member (+org-get-global-property property-name) (org-get-tags))
        (let ((positive-return (org-entry-get nil "TANGLE_FILE_NAME" t)))
             (if positive-return positive-return "yes"))
    "no")
  )
(my-tangle-if-property-in-tags "conftype")

#** making files executable Org tangle will export files each time with standard permissions. In order to make them executable after tangling I need to add the :shebang #!/bin/bash header argument.

encryped private data

this is important for sharing!!!

Org-crypt allows to in document encrypt the content of headings. These headings can just be tagged with :crypt: and they will be encrypted on every safe. Unfortunately one of the pre-tangle-hooks save the buffer before tangling. Thus org will miss code blocks in encrypted headings. Luckily I am not the first one who got to this problem and there is a solution: Org crypt and tangling source blocks - Where parallels cross I now just need to call org-decrypt-entries and then tangle the file.

Other Functions

Functions to generate the readme

(replace-regexp-in-string "\\./\\w+/" "" (org-entry-get nil "TANGLE_FILE_NAME" t))
(print (format "The %s configuration goes into ~%s~." (org-get-heading) <<getTangleFileName>>))

About

My Linux configuration files in a single org-mode document. Features: conditional configuration files, setup with stow, encryption of private information..

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published