-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcustom_init.bash
217 lines (200 loc) · 7.53 KB
/
custom_init.bash
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
alias1()
{
alias_line="alias chrome=\"/goinfre/$USER/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --flag-switches-begin --flag-switches-end --origin-trial-disabled-features=WebGPU --user-data-dir=/goinfre/\$USER/data/Google/Chrome/ --profile-directory=\\\"Default\\\"\""
alias_line2="alias edge=\"/goinfre/$USER/Microsoft\\ Edge.app/Contents/MacOS/Microsoft\\ Edge --flag-switches-begin --flag-switches-end --user-data-dir=/goinfre/\$USER/data/Microsoft\\ Edge\""
alias_line3="alias kode=\"/goinfre/$USER/Visual\\ Studio\\ Code.app/Contents/MacOS/Electron\""
alias_line4="alias st4=\"/goinfre/$USER/Sublime\\ Text.app/Contents/MacOS/sublime_text\""
alias_line5="alias emacs=\"/Applications/Emacs.app/Contents/MacOS/Emacs -nw\""
alias_line6="alias code='open -a \"Visual Studio Code\"'"
deepl="alias deepl=\"/goinfre/$USER/DeepL.app/Contents/MacOS/DeepL\""
hom="export HOME=$HOME"
usr="export USER=$USER"
go="PATH=\$PATH:$HOME/go/bin"
if ! grep -qF "$go" $shell_f; then
echo -e "\n$go" >> $shell_f
# source $shell_f
# cecho "go Alias added." "gray" ""
else
``
# cecho "go Alias already exists." "gray" ""
fi
if ! grep -qF "$hom" $shell_f; then
echo -e "\n$hom" >> $shell_f
# source $shell_f
# cecho "hom Alias added." "gray" ""
else
``
# cecho "hom Alias already exists." "gray" ""
fi
if ! grep -qF "$usr" $shell_f; then
echo -e "\n$usr" >> $shell_f
# source $shell_f
# cecho "usr Alias added." "gray" ""
else
``
# cecho "usr Alias already exists." "gray" ""
fi
if ! grep -qF "$alias_line6" $shell_f; then
echo -e "\n$alias_line6" >> $shell_f
# source $shell_f
# cecho "code Alias added." "gray" ""
else
``
# cecho "code Alias already exists." "gray" ""
fi
if ! grep -qF "$alias_line5" $shell_f; then
echo -e "\n$alias_line5" >> $shell_f
# source $shell_f
# cecho "emacs Alias added." "gray" ""
else
``
# cecho "emacs Alias already exists." "gray" ""
fi
if ! grep -qF "$alias_line4" $shell_f; then
echo -e "\n$alias_line4" >> $shell_f
# source $shell_f
# cecho "st4 Alias added." "gray" ""
else
``
# cecho "st4 Alias already exists." "gray" ""
fi
if ! grep -qF "$alias_line3" $shell_f; then
echo -e "\n$alias_line3" >> $shell_f
# source $shell_f
# cecho "kode Alias added." "gray" ""
else
``
# cecho "kode Alias already exists." "gray" ""
fi
if ! grep -qF "$alias_line" $shell_f; then
echo -e "\n$alias_line" >> $shell_f
# source $shell_f
# cecho "krom Alias added." "gray" ""
else
``
# cecho "krom Alias already exists." "gray" ""
fi
if ! grep -qF "$deepl" $shell_f; then
echo -e "\n$deepl" >> $shell_f
# source $shell_f
# cecho "deepl Alias added." "gray" ""
else
``
# cecho "deepl Alias already exists." "gray" ""
fi
if ! grep -qF "$alias_line2" $shell_f; then
echo -e "\n$alias_line2" >> $shell_f
# source $shell_f
# cecho "edc Alias added." "gray" ""
else
``
# cecho "edc Alias already exists." "gray" ""
fi
murlog "added aliases" "$log_file"
}
customizator()
{
string1="osascript -e 'tell app \"System Events\" to tell appearance preferences to set dark mode to 1'"
string2="export BASH_SILENCE_DEPRECATION_WARNING=1"
# bash_profile
if ! grep "$string2"<"$bash_profile"&>/dev/null; then
echo $string2 >> $bash_profile
fi
# bash_profile
# if ! grep "$string1"<"$bash_profile"&>/dev/null; then
# echo $string1>>$bash_profile
# fi
}
i_app()
{
# https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/33da2bdd-7e25-481e-8d3b-def84868f604/MicrosoftEdge-125.0.2535.92.pkg
edge_url="https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/33da2bdd-7e25-481e-8d3b-def84868f604/MicrosoftEdge-125.0.2535.92.pkg"
edge="/goinfre/$USER/edge.pkg"
gchrome_url="https://dl.google.com/chrome/mac/universal/stable/CHFA/googlechrome.dmg"
gchrome="/goinfre/$USER/gchrome.dmg"
codium_url="https://code.visualstudio.com/sha/download?build=stable&os=darwin-universal"
codium="/goinfre/$USER/codium.zip"
sublime_url="https://download.sublimetext.com/sublime_text_build_4152_mac.zip"
sublime="/goinfre/$USER/sublime.zip"
sublime_merge_url="https://download.sublimetext.com/sublime_merge_build_2091_mac.zip"
sublime_merge="/goinfre/$USER/sublime_merge.zip"
# ----------------------sublime_merge-----------------------
(
local o+="sublime_merge"
if [ ! -f "$sublime_merge" ]; then
o+="\ndownload\n`2>&1 curl -L -o "$sublime_merge" --remote-time "$sublime_merge_url"`"
# cecho "sublime merge indirildi: $sublime_merge" "gray" 'bold'
else
o+="\nskipping download: $sublime_merge"
# cecho "sublime merge already exists, skipping download: $sublime_merge" "gray" 'bold'
fi
o+="\nunzip\n`2>&1 unzip -nq $sublime_merge -d /goinfre/$USER/`"
murlog "$o" "$log_file"
)&
# ----------------------sublime_merge-----------------------
# -------------------------sublime--------------------------
(
local o+="sublime"
if [ ! -f "$sublime" ]; then
o+="\ndownload\n`2>&1 curl -L -o "$sublime" --remote-time "$sublime_url"`"
# cecho "sublime4 indirildi: $sublime" "gray" "bold"
else
o+="\nskipping download: $sublime"
# cecho "sublime4 already exists, skipping download: $sublime" "gray" "bold"
fi
o+="\nunzip\n`2>&1 unzip -nq $sublime -d /goinfre/$USER/`"
murlog "$o" "$log_file"
)&
# -------------------------sublime--------------------------
# ---------------------------edge---------------------------
(
local o+="edge"
if [ ! -f "$edge" ]; then
o+="\ndownload\n`2>&1 curl -L -o "$edge" --remote-time "$edge_url"`"
# cecho "medge indirildi: $edge" "gray" "bold"
else
o+="\nskipping download: $edge"
# cecho "medge already exists, skipping download: $edge" "gray" "bold"
fi
o+="\npkgutil\n`2>&1 pkgutil --expand $edge /goinfre/$USER/tmp`\n"
if ! ls /goinfre/$USER/Microsoft\ Edge.app &> /dev/null ; then
o+="\nuntar\n`2>&1 tar -xf /goinfre/$USER/tmp/MicrosoftEdge*/Payload -C /goinfre/$USER/`"
# cecho "Extraction completed." "gray" "bold"
else
``
# cecho "File already exists. Not extracting." "gray" "bold"
fi
murlog "$o" "$log_file"
)&
# ---------------------------edge---------------------------
# ---------------------------chrome-------------------------
(
local o+="chrome"
if [ ! -f "$gchrome" ]; then
o+="\ndownload\n`2>&1 curl -L -o "$gchrome" --remote-time "$gchrome_url"`"
# cecho "gchrome indirildi: $gchrome" "gray" "bold"
else
o+="\nskipping download: $gchrome"
# cecho "gchrome already exists, skipping download: $gchrome" "gray" "bold"
fi
o+="\nmount\n`2>&1 hdiutil attach -noverify -quiet $gchrome`"
o+="\ncpy\n`2>&1 cp -rn /Volumes/Google\ Chrome/Google\ Chrome.app /goinfre/$USER`"
murlog "$o" "$log_file"
)&
# ---------------------------chrome-------------------------
# ---------------------------code---------------------------
(
local o+="msvscode"
if [ ! -f "$codium" ]; then
o+="\ndownload\n`2>&1 curl -L -o "$codium" --remote-time "$codium_url"`"
# cecho "codium indirildi: $codium" "gray" "bold"
else
o+="\nskipping download: $codium"
# cecho "msvscode already exists, skipping download: $codium" "gray" "bold"
fi
o+="\nunzip\n`2>&1 unzip -nq $codium -d /goinfre/$USER/`"
murlog "$o" "$log_file"
)& wait
# ---------------------------code---------------------------
murlog "installed apps" "$log_file"
}