-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·73 lines (67 loc) · 1.57 KB
/
build.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
#!/bin/bash
set -eu -o pipefail
# globals:
echo -n "Type in this system's username: "
read USER_NAME
[ -z `egrep "^$USER_NAME:" /etc/passwd` ] && echo "Error: user '$USER_NAME' doesn't exists" && exit 1
installer(){
# necessary:
sudo apt install -y \
vim \
zsh \
xclip \
xdotool \
ffmpeg \
nitrogen
# utilities:
sudo apt install -y htop \
inxi \
tmux \
tree \
neofetch \
dconf-editor \
|| true
# dev:
sudo apt install -y git \
cmake \
openssh-server \
postgresql \
ack-grep \
curl \
|| true
# need to install timeshift:
sudo apt-add-repository -y ppa:teejee2008/ppa
sudo apt update
# important:
sudo apt install -y timeshift \
clamav \
gufw \
debsecan \
lynis \
|| true
}
configure_all(){
for DOT_DIR in config-files/.*; do
if [[ -f $DOT_DIR || -d $DOT_DIR ]]; then
cp $DOT_DIR ~/
fi
done
[[ ! -d /usr/local/bin ]] && sudo mkdir /usr/local/bin
cp config-files/scripts/* /usr/local/bin
sed -i "s/\/estevao\//\/$USER_NAME\//" ~/.zshrc
mkdir -p ~/.config/autostart
for DOT_DESKTOP in config-files/*.desktop; do
cp $DOT_DESKTOP ~/.config/autostart/
FILE_NAME=`echo $DOT_DESKTOP | awk -F/ '{print $NF}'`
sed -i "/^Exec/ s/estevao/$USER_NAME/" ~/.config/autostart/$FILE_NAME
done
}
echo "# Installing programs..."
installer
echo "# Configuring all stuff..."
configure_all
echo '# All done
You might want to run the following commands to install and configure oh my zsh:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
sudo sed -i "/^$USER/ s/\/bin\/bash/\/bin\/zsh/" /etc/passwd
'