Files
dotfiles/Install.org
dx 90c727d857 ~modified install to look a bit better
Wrapped all elisp snippets in functions, added a few property arguments
2020-07-16 19:11:40 +01:00

2.7 KiB

Install

Stow all modules

Basically get all folders excluding the '.git' and '.' folder, then just stow them.

folders=`find . -maxdepth 1 -type 'd' -not -name '.git' -not -name '.'`;

# Symlink profiles
for pkg in $folders; do
	echo "Stowing " $pkg;
	stow $pkg
done

Emacs support

Get all modules in Dotfiles

The main function used to retrieve all the stowable modules in the Dotfiles directory.

(defun +dotfiles-install/get-modules ()
  (interactive)
  (cdr
   (reverse
    (split-string
     (shell-command-to-string "find . -maxdepth 1 -type 'd' -not -name '.git' -not -name '.'")
     "\n"))))

Install module

Little elisp snippet to stow a specific module in the Dotfiles folder using completing-read.

(defun +dotfiles-install/install-module ()
  (interactive)
  (async-shell-command (format "stow %s" (completing-read "Stow module: " (get-modules) nil t)) "*stow-output*" "*stow-error*"))

Delete module

Little elisp snippet to delete a stowed module in the Dotfiles folder using completing-read.

(defun +dotfiles-install/delete-module ()
  (interactive)
  (async-shell-command
   (format "stow -D %s" (completing-read "Delete module: " (get-modules) nil t))
   "*stow-output*" "*stow-error*"))

Generate user directories

This makes some useful directories that are used by the system and/or by me. I split these into two sections so you can execute the ones you think are useful.

System folders

mkdir ~/.local;
mkdir ~/.local/src;
mkdir ~/.local/bin;

mkdir ~/.config;

User folders

Firstly the essentials for a good user experience™

mkdir ~/Downloads ~/Pictures ~/Music;

Then generate the other stuff that I use (mostly).

mkdir ~/Text;
mkdir ~/School;
mkdir ~/Code;
mkdir ~/Code/Learning;
mkdir ~/Code/Projects;
mkdir ~/Code/Templates;

Clone templates

These are templates coded by me (MIT licensed) which are basically boilerplate helpers for differing languages. They allow me to quickly start coding up projects as they remove the hassle of setting the build system and source directories up manually. They're cloned into ~/Code/Templates not only so you can hack on them as you wish but also so you can generate templates even when offline just by copying the template you want and removing/replacing the '.git' directory in it.

declare -a templates=("CTemplate" "CPPTemplate" "PythonTemplate"
					  "NodeTemplate" "ArduinoTemplate");
for template in ${templates[@]}; do
	git clone https://github.com/odavep/$template ~/Code/Templates/$template;
done