-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·118 lines (105 loc) · 2.83 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·118 lines (105 loc) · 2.83 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
#!/usr/bin/bash
# SYSTEM UPDATE
echo
read -p 'Do you want to update your system? (y/n) ' -n 1 -r < /dev/tty
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
sudo apt-get update -y
sudo apt-get upgrade -y
fi
# TIMEZONE
echo
echo 'These are your actual time settings:'
timedatectl
echo
read -p 'Do you want to change your system timezone? (y/n) ' -n 1 -r < /dev/tty
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
read -p 'Time zone (eg: America/Panama): ' < /dev/tty
if [[ ! -z $REPLY ]]
then
sudo timedatectl set-timezone $REPLY
echo 'These are your new time settings:'
timedatectl
fi
echo
fi
# GIT install
if ! command -v git &> /dev/null
then
source gitsetup.sh
fi
# DIRNAMES
CONFDIR=$HOME/.config
BASHDIR=$CONFDIR/bash
SRCDIR=$HOME/src
BASEDIR=$SRCDIR/dotfiles
# DIR CREATION
mkdir -p "$BASHDIR"
mkdir -p "$SRCDIR"
# DOTFILES REPO
cd "$SRCDIR" || exit
[[ -d dotfiles ]] || git clone https://github.com/swordf1zh/dotfiles.git
cd "$HOME" || exit
# ╔═╗┌─┐┌─┐┌┬┐┬ ┬┌─┐┬─┐┌─┐
# ╚═╗│ │├┤ │ │││├─┤├┬┘├┤
# ╚═╝└─┘└ ┴ └┴┘┴ ┴┴└─└─┘
echo
read -p 'Do you want to install software? (y/n) ' -n 1 -r < /dev/tty
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
cat <<EOF
╔═╗┌─┐┌─┐┌┬┐┬ ┬┌─┐┬─┐┌─┐
╚═╗│ │├┤ │ │││├─┤├┬┘├┤
╚═╝└─┘└ ┴ └┴┘┴ ┴┴└─└─┘
EOF
for FILEPATH in "$BASEDIR"/software/*.bash;
do
FILENAME=$(basename -- "$FILEPATH")
EXTENSION="${FILENAME##*.}"
FILE="${FILENAME%.*}"
echo
read -p "Do you want to install $FILE? (y/n) " -n 1 -r < /dev/tty
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
source "$FILEPATH"
fi
done
sudo apt-get autoremove -y
fi
# ╔═╗╦ ╦ ┌┬┐┌─┐┌─┐┬ ┌─┐
# ║ ║ ║ │ │ ││ ││ └─┐
# ╚═╝╩═╝╩ ┴ └─┘└─┘┴─┘└─┘
echo
read -p 'Do you want to install CLI-tools? (y/n) ' -n 1 -r < /dev/tty
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
cat <<EOF
╔═╗╦ ╦ ┌┬┐┌─┐┌─┐┬ ┌─┐
║ ║ ║ │ │ ││ ││ └─┐
╚═╝╩═╝╩ ┴ └─┘└─┘┴─┘└─┘
EOF
for FILEPATH in "$BASEDIR"/cli-tools/*.bash;
do
FILENAME=$(basename -- "$FILEPATH")
EXTENSION="${FILENAME##*.}"
FILE="${FILENAME%.*}"
echo
read -p "Do you want to install $FILE? (y/n) " -n 1 -r < /dev/tty
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
source "$FILEPATH"
fi
done
sudo apt-get autoremove -y
fi
ln -sf "$BASEDIR"/bash_/aliases.bash "$BASHDIR"/aliases.bash
ln -sf "$BASEDIR"/bash_/docker.bash "$BASHDIR"/docker.bash
ln -sf "$BASEDIR"/.bashrc "$HOME"/.bashrc
source "$HOME"/.bashrc