-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_user.sh
55 lines (45 loc) · 1.26 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
55
#!/bin/bash
mkdir -p "/home/$(whoami)/Documents"
mkdir -p "/home/$(whoami)/Downloads"
# This sets the keyboard to Norwegian layout. Change to your preference
localectl --no-convert set-x11-keymap no
# Install packages from AUR
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
# Install dotfiles
DOTFILES="/home/$(whoami)/dotfiles"
if [ ! -d "$DOTFILES" ]; then
git clone https://github.com/LarsJohansen/dotfiles.git \
"$DOTFILES" >/dev/null
fi
source "$DOTFILES/zsh/.zshenv"
cd "$DOTFILES" && bash install.sh