-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall.sh
executable file
·114 lines (87 loc) · 2.84 KB
/
install.sh
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/sh
rm ~/.emacs
emacs -q --debug-init --load "build.el"
texhash
cat > ~/.emacs <<- EOM
(load-file "~/.emacs.d/elisp/config-main.el")
EOM
exit;
# Install reveal.js....
pwd=$(pwd)
revealdir=~/.emacs.d/reveal.js
if [ ! -d $revealdir ]; then
# Control will enter here if $DIRECTORY doesn't exist.
printf "\n Installing reveal to: %s !\n\n" $revealdir;
cd ~/.emacs.d/
git clone https://github.com/hakimel/reveal.js.git
cd $pwd
fi
powerlinedir=~/programs/powerlinefonts
if [ ! -d $powerlinedir ]; then
printf "\n Installing powerline to: %s !\n\n" $powerlinedir;
git clone https://github.com/powerline/fonts.git $powerlinedir
cd $powerlinedir
./install.sh
cd $pwd
fi
# look for oh-myzsh ...
ohmyzshdir=~/.oh-my-zsh
if [ ! -d $ohmyzshdir ]; then
printf "\n Installing oh-my-zsh to: %s !\n\n" $ohmyzshdir;
git clone https://github.com/robbyrussell/oh-my-zsh.git $ohmyzshdir
fi
# look for offlineimap
offlineimapdir=~/programs/offlineimap
if [ ! -d $offlineimapdir ]; then
printf "\n Installing offlineimap to: %s !\n\n" $offlineimapdir;
git clone https://github.com/OfflineIMAP/offlineimap.git $offlineimapdir
fi
mudir=~/programs/mu
if [ ! -d $mudir ]; then
printf "\n Installing mu to: %s !\n\n" $mudir;
git clone https://github.com/djcb/mu.git $mudir
cd $mudir
./autogen.sh
make
cd $pwd
fi
stow emacs -t ~/
stow zsh -t ~/
# make init.el
printf "\n Writing init.el \n\n";
cat > ~/.emacs.d/init_test.el <<- EOM
;; printed by install.sh
(defvar init.org-message-depth 3
"What depth of init.org headings to message at startup.")
(with-temp-buffer
(insert-file-contents (expand-file-name "config.org" user-emacs-directory))
(goto-char (point-min))
;; Skip straight to the first elisp code block.
(re-search-forward "^[\s-]*#\\\+BEGIN_SRC +emacs-lisp$")
;; Set point to previous heading
(re-search-backward (format "\\\*\\\{1,%s\\\} +.*$"
init.org-message-depth))
;; ;; Alternatively, you can have all elisp code blocks under a single parent heading.
;; (search-forward "\n* init.el")
;; Begin parsing org file.
(while (not (eobp))
(forward-line 1)
(cond
;; Report Headings
((looking-at
(format "\\\*\\\{1,%s\\\} +.*$"
init.org-message-depth))
(message "%s" (match-string 0))) ;; Messages where currently parsing.
;; Evaluate Code Blocks
((looking-at "^[\s-]*#\\\+BEGIN_SRC +emacs-lisp$")
(let ((l (match-end 0)))
(search-forward "#+END_SRC")
;; Write evaluated elisp source blocks to a single file.
;;(append-to-file l (match-beginning 0) "testinitorg.el")
(eval-region l (match-beginning 0))))
;; Finish on the next level-1 heading
((looking-at "^\\\* ")
(goto-char (point-max)))))
;; Startup message.
(message "Don't Panic."))
EOM