-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
158 lines (129 loc) · 4.24 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#!/bin/bash
#--------------------------------------------------------------------------#
# This is an install/update script for the config files in this repo.
echo $0
full_path=$(realpath $0)
echo $full_path
dir_path=$(dirname $full_path)
echo $dir_path
rel_dir_path=$(dirname $dir_path )
echo $rel_dir_path
#bash dir
bash_dir="$rel_dir_path/bash"
bash_fedora_dir="$rel_dir_path/bash/fedora"
bash_garuda_dir="$rel_dir_path/bash/garuda"
#fish dir
fish_dir="$rel_dir_path/fish"
fish_fedora_dir="$rel_dir_path/fish/fedora"
fish_garuda_dir="$rel_dir_path/fish/garuda"
#starship dir
starship_dir="$rel_dir_path/starship"
starship_fedora_dir="$rel_dir_path/starship/fedora"
starship_garuda_dir="$rel_dir_path/starship/garuda"
#terminator dir
terminator_dir="$rel_dir_path/terminator"
terminator_fedora_dir="$rel_dir_path/terminator/fedora"
terminator_garuda_dir="$rel_dir_path/terminator/garuda"
echo '
This is a script which installs the config files onto your machine.
'
read -p 'Do you want to install(i) or update(u) the config files?' check
if [ $check == "i" ]
then
read -p 'Do you want to install the garuda(g) or the fedora(f) version?' check2
if [ $check2 == "g" ]
then
# bash
rm /home/$USER/.bashrc && rm /home/$USER/.bash_profile
cp $bash_garuda_dir/.bashrc /home/$USER && cp $bash_garuda_dir/.bash_profile /home/$USER
# fish
rm /home/$USER/.config/fish/config.fish
cp $fish_garuda_dir/config.fish /home/$USER/.config/fish/config.fish
# starship
cp $starship_garuda_dir/starship.toml /home/$USER/.config
# terminator
rm /home/$USER/.config/terminator/config
cp $terminator_garuda_dir/config /home/$USER/.config/terminator
echo 'The script has finished'
if [ $check2 == "f" ]
then
# bash
rm /home/$USER/.bashrc && rm /home/$USER/.bash_profile
cp $bash_fedora_dir/.bashrc /home/$USER && cp $bash_fedora_dir/.bash_profile /home/$USER
# fish
rm /home/$USER/.config/fish/config.fish
cp $fish_fedora_dir/config.fish /home/$USER/.config/fish/config.fish
# starship
cp $starship_fedora_dir/starship.toml /home/$USER/.config
# terminator
rm /home/$USER/.config/terminator/config
cp $terminator_fedora_dir/config /home/$USER/.config/terminator
echo 'The script has finished'
if [ $check == "u" ]
then
read -p 'Do you want to install the garuda(g) or the fedora(f) version?' check2
if [ $check2 == "g" ]
echo 'Your config files getting updated, choose from the list below which you want to update:
1: bash
2: fish
3: starship
4: terminator
'
read -p 'Enter the number of the type of config you would like to update: ' updateVar
if [ $updateVar == 1 ]
then
# bash
rm /home/$USER/.bashrc && rm /home/$USER/.bash_profile
cp $bash_garuda_dir/.bashrc /home/$USER && cp $bash_garuda_dir/.bash_profile /home/$USER
echo 'Config file updated'
if [ $updateVar == 2 ]
then
# fish
rm /home/$USER/.config/fish/config.fish
cp $fish_garuda_dir/config.fish /home/$USER/.config/fish/config.fish
echo 'Config file updated'
if [ $updateVar == 3 ]
then
# starship
rm /home/$USER/.config/starship.toml
cp $starship_garuda_dir/starship.toml /home/$USER/.config
echo 'Config file updated'
if [ $updateVar == 4 ]
then
# terminator
rm /home/$USER/.config/terminator/config
cp $terminator_garuda_dir/config /home/$USER/.config/terminator
echo 'Config file updated'
if [ $check2 == "f" ]
then
echo 'Your config files getting updated, choose from the list below which you want to update:
1: bash
2: fish
3: starship
4: terminator
'
read -p 'Enter the number of the type of config you would like to update: ' updateVar
if [ $updateVar == 1 ]
then
# bash
rm /home/$USER/.bashrc && rm /home/$USER/.bash_profile
cp $bash_fedora_dir/.bashrc /home/$USER && cp $bash_fedora_dir/.bash_profile /home/$USER
echo 'Config file updated'
if [ $updateVar == 2 ]
then
# fish
rm /home/$USER/.config/fish/config.fish
cp $fish_fedora_dir/config.fish /home/$USER/.config/fish/config.fish
echo 'Config file updated'
if [ $updateVar == 3 ]
then
# starship
rm /home/$USER/.config/starship.toml
cp $starship_fedora_dir/starship.toml /home/$USER/.config
echo 'Config file updated'
if [ $updateVar == 4 ]
then
# terminator
rm /home/$USER/.config/terminator/config
cp $terminator_fedora_dir/config /home/$USER/.config/terminator
echo 'Config file updated'