1 | #!/bin/bash |
2 |
|
3 | HELPTEXT="./install.sh <desktop|laptop|headless>" |
4 | case $1 in |
5 | h|help|\?|-h|-help|-\?|--h|--help|--\?) |
6 | echo -e $HELPTEXT |
7 | exit 0 |
8 | ;; |
9 | desktop) |
10 | UNIT=DESKTOP |
11 | ;; |
12 | laptop) |
13 | UNIT=LAPTOP |
14 | ;; |
15 | headless) |
16 | UNIT=HEADLESS |
17 | ;; |
18 | *) |
19 | echo -e $HELPTEXT |
20 | exit 0 |
21 | ;; |
22 | esac |
23 |
|
24 | category(){ |
25 | echo -e " \e[1;37m$1\e[0m" |
26 | } |
27 |
|
28 | item(){ |
29 | echo -e " \e[0m$1\e[0m" |
30 | } |
31 |
|
32 | echo -e " \e[1;33mInstall type \e[1;35m$UNIT\e[0m" |
33 |
|
34 | # Bash config |
35 | category "Bash config" |
36 | item "~/.bash_aliases" |
37 | install .bash_aliases $HOME/.bash_aliases |
38 | item "~/.bashrc" |
39 | install .bashrc $HOME/.bashrc |
40 | item "~/.profile" |
41 | install .profile $HOME/.profile |
42 |
|
43 | category "Common folders" |
44 | item "~/src/" |
45 | SRCFOLDER=$HOME/src |
46 | mkdir -p $SRCFOLDER |
47 |
|
48 | # Local scripts |
49 | category "Local scripts" |
50 | LOCALBIN=$HOME/.local/bin |
51 | if [ $UNIT == "DESKTOP" ]; then |
52 | item "~/.local/bin/middle-mouse-scroll" |
53 | install middle-mouse-scroll $LOCALBIN/middle-mouse-scroll |
54 | fi |
55 | item "~/.local/bin/minesweeper" |
56 | if [ ! -f $LOCALBIN/minesweeper ]; then |
57 | git clone --depth=1 git://joshstock.in/ncurses-minesweeper.git $SRCFOLDER/ncurses-minesweeper |
58 | cd $SRCFOLDER/ncurses-minesweeper |
59 | make compile build |
60 | install bin/minesweeper $LOCALBIN/minesweeper |
61 | rm -rf $SRCFOLDER/ncurses-minesweeper |
62 | fi |
63 |
|
64 | if [ $UNIT == "DESKTOP" ] || [ $UNIT == "LAPTOP" ]; then |
65 | # GTK config |
66 | category "GTK config" |
67 |
|
68 | GTKDIR=$HOME/.config/gtk-3.0 |
69 | item "~/.config/gtk-3.0/" |
70 | mkdir -p $GTKDIR |
71 |
|
72 | item "~/.config/gtk-3.0/gtk.css" |
73 | install gtk.css $GTKDIR/gtk.css |
74 |
|
75 | item "Terminal theme 'Oceanic Next'" |
76 | ./terminal_theme.sh $1 &>/dev/null |
77 |
|
78 | # Fonts |
79 | category "Fonts" |
80 |
|
81 | item "~/.fonts/" |
82 | FONTDIR=$HOME/.fonts |
83 | mkdir -p $FONTDIR |
84 |
|
85 | item "Fira Sans pack" |
86 |
|
87 | item "Fira Mono (Powerline-patched) pack" |
88 | if [ ! -f $FONTDIR/FiraMono-Regular.otf ]; then |
89 | curl -fLso $FONTDIR/FiraMono-Regular.otf https://github.com/powerline/fonts/raw/master/FiraMono/FuraMono-Regular%20Powerline.otf |
90 | fi |
91 | if [ ! -f $FONTDIR/FiraMono-Medium.otf ]; then |
92 | curl -fLso $FONTDIR/FiraMono-Medium.otf https://github.com/powerline/fonts/raw/master/FiraMono/FuraMono-Medium%20Powerline.otf |
93 | fi |
94 | if [ ! -f $FONTDIR/FiraMono-Bold.otf ]; then |
95 | curl -fLso $FONTDIR/FiraMono-Bold.otf https://github.com/powerline/fonts/raw/master/FiraMono/FuraMono-Bold%20Powerline.otf |
96 | fi |
97 |
|
98 | item "Refreshing font cache" |
99 | fc-cache |
100 | fi |
101 |
|
102 | # Global git config |
103 | category "Global git config" |
104 |
|
105 | item "~/.gitconfig" |
106 | install .gitconfig $HOME/.gitconfig |
107 |
|
108 | # Vim |
109 | category "Vim config" |
110 |
|
111 | item "~/.vim/" |
112 | VIMDIR=$HOME/.vim |
113 | mkdir -p $VIMDIR |
114 |
|
115 | item "~/.vim/vimrc" |
116 | if [ $UNIT == "HEADLESS" ]; then |
117 | grep -v "RMHEADLESS" vimrc > $VIMDIR/vimrc |
118 | else |
119 | install vimrc $VIMDIR/vimrc |
120 | fi |
121 |
|
122 | item "~/.vim/autoload/plug.vim" |
123 | curl -fLso $VIMDIR/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |
124 |
|
125 | # Done |
126 | echo -e " \e[1;33mDONE\e[0m" |
127 |
|