-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheali-i3
More file actions
executable file
·250 lines (218 loc) · 5.33 KB
/
Copy patheali-i3
File metadata and controls
executable file
·250 lines (218 loc) · 5.33 KB
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
#!/usr/bin/bash
set -eu
########## VARIABLES ##########
### ANSI ESCAPE code ###
prefix="\e["
suffix="m"
SGRRESET="${prefix}${suffix}"
BOLD="${prefix}1${suffix}"
RED="${prefix}31${suffix}"
GREEN="${prefix}32${suffix}"
YELLOW="${prefix}33${suffix}"
BLUE="${prefix}34${suffix}"
MAGENTA="${prefix}35${suffix}"
CYAN="${prefix}36${suffix}"
WHITE="${prefix}37${suffix}"
### FLAG ###
FLAG=false
########## functions ##########
# error message
error(){
printf "${RED}[error]${SGRRESET}: ${1}\n"
}
# confirmation message
confirmation(){
printf "${CYAN}[confirmation]${SGRRESET}: ${1}\n"
}
########## Title ##########
printf "\n${BOLD}${MAGENTA}EASY ARCHLINUX INSTALLER (i3)${SGRRESET}\n\n"
########## set user password ##########
if [[ ! -v EALI_USER_PASSWD ]]
then
read -sp "Type user password : " EALI_USER_PASSWD
echo ""
fi
echo ""
# Package upgrade
sudo -K
yay --sudoflags -S --noconfirm -Syu <<EOF
${EALI_USER_PASSWD}
EOF
# Display server
sudo -K
yay --sudoflags -S --noconfirm -S xorg-server <<EOF
${EALI_USER_PASSWD}
EOF
echo ""
# Installation of xfce4 has a question
# xfce4
sudo -K
sudo -S pacman -S i3<<EOF
${EALI_USER_PASSWD}
y
EOF
mkdir -p ${HOME}/.config/i3
cat /etc/i3/config > ${HOME}/.config/i3/config
sed -e 's/Mod1/Mod4/g' -i ${HOME}/.config/i3/config
# Display Driver
printf "This is graphics hardware information of this computer \n"
printf "==================================================\n"
lspci -k | grep -EA3 "VGA|3D|Display"
printf "==================================================\n"
if [[ ! -v EALI_DISPLAY_DRIVER || "${EALI_DISPLAY_DRIVER})" = "" ]]
then
while true
do
read -p "type display driver name : " EALI_DISPLAY_DRIVER
if [[ "${EALI_DISPLAY_DRIVER}" = "" ]]
then
confirmation "No display driver specified. Do you want to skip installing the display driver? "
read -p " y|Y for yes, any other key for No : " str
case $str in
y|Y)
echo ""
break;;
*)
echo "Please try again";;
esac
else
confirmation " display driver is '${EALI_DISPLAY_DRIVER}'"
read -p " y|Y for yes, any other key for No : " str
case $str in
y|Y)
echo ""
break;;
*)
echo "Please try again";;
esac
fi
done
fi
# Display driver
if [[ "${EALI_DISPLAY_DRIVER}" = "" ]]
then
:
else
sudo -K
yay --sudoflags -S --noconfirm -S <<EOF
${EALI_USER_PASSWD}
EOF
fi
# Display manager
sudo -K
yay --sudoflags -S --noconfirm -S lightdm lightdm-gtk-greeter light-locker <<EOF
${EALI_USER_PASSWD}
EOF
cat <<EOF > ${HOME}/.xprofile
#!/bin/sh
# "light-locker-command -1" screen lock
light-locker --lock-on suspend &
EOF
# enable lightdm.service
sudo -K
sudo -S systemctl enable lightdm <<EOF
${EALI_USER_PASSWD}
EOF
# Audio
sudo -K
yay --sudoflags -S --noconfirm -S pulseaudio pavucontrol <<EOF
${EALI_USER_PASSWD}
EOF
# fonts
sudo -K
yay --sudoflags -S --noconfirm -S noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-extra <<EOF
${EALI_USER_PASSWD}
EOF
cat <<EOF >~/local.conf.temp
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>serif</family>
<prefer>
<family>Noto Serif</family>
<family>Noto Serif CJK JP</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Noto Sans</family>
<family>Noto Sans CJK JP</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Noto Sans Mono</family>
<family>Noto Sans Mono CJK JP</family>
</prefer>
</alias>
</fontconfig>
EOF
sudo -K
sudo -S cp ${HOME}/local.conf.temp /etc/fonts/local.conf<<EOF
${EALI_USER_PASSWD}
EOF
fc-cache -f
rm ${HOME}/local.conf.temp
# Japanese input method
sudo -K
yay --sudoflags -S --noconfirm -S fcitx fcitx-mozc fcitx-configtool <<EOF
${EALI_USER_PASSWD}
EOF
echo ""
sudo -K
sudo -S pacman -S fcitx-im <<EOF
${EALI_USER_PASSWD}
y
EOF
cat <<EOF >> ${HOME}/.xprofile
# for fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
EOF
fcitx
# terminal
sudo -K
yay --sudoflags -S --noconfirm -S xterm xorg-xinit xorg-xrdb <<EOF
${EALI_USER_PASSWD}
EOF
cat <<EOF >~/.xinitrc
[[ -f ~/.Xresources ]] && xrdb -merge -I{$HOME} ~/.Xresources
EOF
cat <<EOF >~/.Xresources
xterm*termName: xterm-256color
xterm*locale: true
xterm*selectToClipboard: true
xterm*saveLines: 4096
xterm*metaSendsEscape: true
xterm*faceName: HackGen35Console-Reguler:size=10:antialias=false
xterm*font: 7x13
URxvt.perl-ext-common: xim-onthespot
URxvt.inputMethod: fcitx
URxvt*preeditType: OnTheSpot
EOF
# fonts for terminal
sudo -K
yay --sudoflags -S --noconfirm -S ttf-hackgen <<EOF
${EALI_USER_PASSWD}
EOF
# utils
sudo -K
yay --sudoflags -S --noconfirm -S xorg-xset dmenu <<EOF
${EALI_USER_PASSWD}
EOF
cat <<EOF > ${HOME}/locale.conf.temp
LANG=ja_JP.UTF-8
EOF
sudo -K
sudo -S cp ${HOME}/locale.conf.temp /etc/locale.conf <<EOF
${EALI_USER_PASSWD}
EOF
rm ${HOME}/locale.conf.temp
########## Install finished ##########
printf "\n\n==============================\n"
printf "${GREEN}${BOLD}Successfully Installed!!${SGRRESET} \n"
printf "==============================\n\n"