-
Notifications
You must be signed in to change notification settings - Fork 0
/
aptsos_stage2.sh
197 lines (155 loc) · 5.71 KB
/
aptsos_stage2.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
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
error() { \
clear; printf "ERROR:\\n%s\\n" "$1" >&2; exit 1;
}
welcome() { \
dialog --colors --title "\Z7\ZbStage 2 of Installing Aptsos!" --msgbox "\Z4Packages and Configurations will be installed in this stage" 9 60
dialog --colors --title "\Z7\ZbStay Active!" --yes-label "Continue" --no-label "Exit" --yesno "\Z4You might need enter sudo password!\n\nContinue installation?" 6 60
}
welcome || error "User choose to exit."
get_input () {
local user_input=$(\
dialog --title "$1" \
--inputbox "$2" 8 40 \
3>&1 1>&2 2>&3 3>&- \
)
echo $user_input
}
sudo reflector --sort score --latest 10 --protocol http,https --save /etc/pacman.d/mirrorlist
sudo pacman -Sy
clear;
echo "##########################"
echo "## Install sound system ##"
echo "##########################"
sudo pacman --needed --ask 4 -Sy - < packages/sound.txt || error "Failed to install required packages."
clear;
echo "#####################################"
echo "## Install drivers and filesystems ##"
echo "#####################################"
sudo pacman --needed --ask 4 -Sy - < packages/drivers.txt || error "Failed to install required packages."
clear;
echo "###################"
echo "## Install fonts ##"
echo "###################"
sudo pacman --needed --ask 4 -Sy - < packages/fonts.txt || error "Failed to install required packages."
clear;
echo "####################"
echo "## Install themes ##"
echo "####################"
sudo pacman --needed --ask 4 -Sy - < packages/themes.txt || error "Failed to install required packages."
clear;
echo "#############################################################"
echo "## Install x server and Window Manager and needed packages ##"
echo "#############################################################"
sudo pacman --needed --ask 4 -Sy - < packages/gui.txt || error "Failed to install required packages."
clear;
echo "#################################"
echo "## Install aur package manager ##"
echo "#################################"
cd /tmp
git clone https://aur.archlinux.org/yay-bin.git
cd yay-bin
makepkg -si --noconfirm
cd ~
yay --noconfirm --needed -S ttf-inconsolata-nerd nerd-fonts-fantasque-sans-mono nerd-fonts-inconsolata dracula-gtk-theme
clear;
echo "#######################"
echo "## Activate services ##"
echo "#######################"
systemctl enable --user pipewire-pulse pipewire
clear;
echo "########################"
echo "## Instal wallpapers ##"
echo "#######################"
cd ~
xdg-user-dirs-update
cd Pictures
git clone https://github.com/alishahidi/wallpapers
mv wallpapers Wallpapers
cd ~
clear;
echo "######################"
echo "## Fix some problem ##"
echo "#######################"
# Disable random mac address
echo -e "[device]\nwifi.scan-rand-mac-address=no" | sudo tee /etc/NetworkManager/conf.d/disable-random-mac.conf
# tap to click
echo 'Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
Option "Tapping" "on"
EndSection' | sudo tee /etc/X11/xorg.conf.d/40-libinput.conf
clear;
echo "#########################################"
echo "## Install zsh and oh-my-zsh framework ##"
echo "#########################################"
sudo pacman --noconfirm --needed -S zsh wget exa figlet lolcat curl git fzf || error "Error install diolog."
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/agkozak/zsh-z ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-z
echo "##########################"
echo "## Change default shell ##"
echo "##########################"
chsh -s $(which zsh)
clear;
echo "######################"
echo "## Install Configs ##"
echo "######################"
cd ~
mkdir -p Git/alishahidi
cd Git/alishahidi
git clone https://github.com/alishahidi/dotfiles
cd dotfiles
sudo cp -r etc usr /
cp -r .config/* ~/.config
cp .xinitrc ~
cp .xprofile ~
cp .zshrc ~
cd ~
clear;
echo "########################"
echo "## Install dmenu_apts ##"
echo "########################"
cd ~
cd Git/alishahidi
git clone https://github.com/alishahidi/dmenu_apts
cd dmenu_apts
sudo make install
cd ~
clear;
echo "#########################################################"
echo "## Installing Doom Emacs. This may take a few minutes. ##"
echo "#########################################################"
sudo pacman --noconfirm --needed -S emacs-nativecomp
git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d
~/.config/emacs/bin/doom -! install
~/.config/emacs/bin/doom sync
clear;
echo "#############################"
echo "## Make scripts executable ##"
echo "#############################"
find $HOME/.local/bin -type f -print0 | xargs -0 chmod 775
find $HOME/.config/scripts -type f -print0 | xargs -0 chmod 775
find $HOME/.config/status_scripts -type f -print0 | xargs -0 chmod 775
clear;
echo "########################################"
echo "## At first time using emacs ##"
echo "## run killall emacs ##"
echo "## & run /usr/bin/emacs --daemon ##"
echo "## & anser y for every question asked ##"
echo "########################################"
clear;
echo "##############################"
echo "## Aptsos stage 2 complete ##"
echo "##############################"
while true; do
read -p "Do you want to reboot? recommended [Y/n] " yn
case $yn in
[Yy]* ) reboot;;
[Nn]* ) break;;
"" ) reboot;;
* ) echo "Please answer yes or no.";;
esac
done