blob: f162e5f92468a5cfd131e913d5c7b912ca8c6562 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
#+TITLE: Install
* Stow all modules
Basically get all folders excluding the '.git' and '.' folder, then just stow them.
#+BEGIN_SRC sh
folders=`find . -maxdepth 1 -type 'd' -not -name '.git' -not -name '.'`;
# Symlink profiles
for pkg in $folders; do
echo "Stowing " $pkg;
stow $pkg
done
#+END_SRC
* Emacs support
** Get all modules in Dotfiles
The main function used to retrieve all the stowable modules in the Dotfiles directory.
#+BEGIN_SRC elisp
(defun get-modules ()
(interactive)
(cdr
(reverse
(split-string
(shell-command-to-string "find . -maxdepth 1 -type 'd' -not -name '.git' -not -name '.'")
"\n"))))
#+END_SRC
** Stow module
Little elisp snippet to stow a specific module in the Dotfiles folder using ivy.
#+BEGIN_SRC elisp
(async-shell-command (format "stow %s" (completing-read "Stow module: " (get-modules) nil t)) "*stow-output*" "*stow-error*")
#+END_SRC
** Delete module
#+BEGIN_SRC elisp
(async-shell-command
(format "stow -D %s" (completing-read "Delete module: " (get-modules) nil t))
"*stow-output*" "*stow-error*")
#+END_SRC
* 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
#+BEGIN_SRC sh
mkdir ~/.local;
mkdir ~/.local/src;
mkdir ~/.local/bin;
mkdir ~/.config;
#+END_SRC
** User folders
Firstly the essentials for a good user experience™
#+BEGIN_SRC sh
mkdir ~/Downloads ~/Pictures ~/Music;
#+END_SRC
Then generate the other stuff that I use (mostly).
#+BEGIN_SRC sh
mkdir ~/Text;
mkdir ~/School;
mkdir ~/Code;
mkdir ~/Code/Learning;
mkdir ~/Code/Projects;
mkdir ~/Code/Templates;
#+END_SRC
* 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.
#+BEGIN_SRC sh
declare -a templates=("CTemplate" "CPPTemplate" "PythonTemplate"
"NodeTemplate" "ArduinoTemplate");
for template in ${templates[@]}; do
git clone https://github.com/odavep/$template ~/Code/Templates/$template;
done
#+END_SRC
|