-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·70 lines (49 loc) · 1.39 KB
/
setup.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
#!/usr/bin/env bash
set -euo pipefail
stderr() {
echo "${@}" 1>&2
}
fail() {
stderr "${1}"
stderr ""
stderr "Exiting …"
exit "${2:-1}"
}
readonly DOTFILES="${HOME}/dotfiles"
while [[ ${ready:-x} != 'y' ]]; do
echo "Have you cloned dotfiles into ${DOTFILES}? (y/n)"
read -rn 1 ready
echo -e "\n"
done;
cd "${DOTFILES}"
echo "Do you want a minimal setup? [Y/n]"
read -rn 1 yn
if [[ "${yn}" == [Nn]* ]]; then
readonly FULL_SETUP=y
else
readonly FULL_SETUP=n
fi
echo -e "\n"
./bootstrap.sh
sudo ln -fs "$(which safe-rm)" /usr/local/bin/rm
if [[ "${FULL_SETUP}" == y ]]; then
pushd ~/.config
ln -fs "${DOTFILES}/.config/safe-rm" .
ln -fs "${DOTFILES}/.config/sway" .
popd
echo "Installing custom keyboard layouts"
sudo cp "${DOTFILES}/usr/share/X11/xkb/symbols"/* -t /usr/share/X11/xkb/symbols
# Set shell
sudo chsh -s /usr/bin/zsh "${USER}"
# Configure locale
sudo locale-gen sv_SE.UTF-8
( sudo tee -a /etc/default/locale ) < ~/dotfiles/locale/sv_SE
# Set NeoVim as default editor
sudo update-alternatives --install /usr/bin/vim vim "$(which nvim)" 100
sudo update-alternatives --install /usr/bin/editor editor "$(which nvim)" 100
# Add me to the `docker` group
sudo usermod -aG docker "${USER}"
echo "Creating ${APT_DIR}"
mkdir -p "${APT_DIR}"
sudo chown -R "_apt:${USER}" "${APT_DIR}"
fi