-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_user.sh
54 lines (45 loc) · 1.33 KB
/
install_user.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
#!/bin/bash
mkdir -p "/home/$(whoami)/Documents"
mkdir -p "/home/$(whoami)/Downloads"
# Uncomment to set the keymap you want. Replace "fr" by your country code
# localectl --no-convert set-x11-keymap fr
# Function able to install any package from the AUR (needs the package names as arguments).
aur_install() {
curl -O "https://aur.archlinux.org/cgit/aur.git/snapshot/$1.tar.gz" \
&& tar -xvf "$1.tar.gz" \
&& cd "$1" \
&& makepkg --noconfirm -si \
&& cd - \
&& rm -rf "$1" "$1.tar.gz"
}
aur_check() {
qm=$(pacman -Qm | awk '{print $1}')
for arg in "$@"
do
if [[ "$qm" != *"$arg"* ]]; then
yay --noconfirm -S "$arg" &>> /tmp/aur_install \
|| aur_install "$arg" &>> /tmp/aur_install
fi
done
}
cd /tmp
dialog --infobox "Installing \"Yay\", an AUR helper..." 10 60
aur_check yay
count=$(wc -l < /tmp/aur_queue)
c=0
cat /tmp/aur_queue | while read -r line
do
c=$(( "$c" + 1 ))
dialog --infobox \
"AUR install - Downloading and installing program $c out of $count: $line..." \
10 60
aur_check "$line"
done
DOTFILES="/home/$(whoami)/dotfiles"
if [ ! -d "$DOTFILES" ]; then
# Clone dotfiles.git
git clone https://github.com/ajkingio/dotfiles.git \
"$DOTFILES" >/dev/null
fi
source "$DOTFILES/zsh/.zshenv"
cd "$DOTFILES" && bash install.sh