-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·68 lines (52 loc) · 2.06 KB
/
install.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
#!/usr/bin/env bash
echo "ℹ️ Setting up dotfiles"
if [[ $(uname -s) != "Darwin" ]]
then
echo "❌ This system is not a macOS system, found: $(uname -s). Exiting."
exit -1
fi
# Install Homebrew if not already installed
if ! command -v brew &> /dev/null
then
echo "🍺 Installing Homebrew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
else
echo "🍺 Homebrew Already Installed"
fi
dotfiles_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd ${dotfiles_dir}
# Install brew-managed software
echo "💻 Installing & updating brew-managed software"
brew bundle
# Set Basic Settings
echo "🌎 Setting Firefox as the default browser"
defaultbrowser firefox
mkdir_log() {
echo "📁 Creating directory $1"
mkdir -p $1
}
# Some useful directories
mkdir_log "${HOME}/github.com/"
mkdir_log "${HOME}/Pictures/Screenshots/"
# Symlink everything
link() {
source="$1"
target="$2"
desc="$3"
echo "🔗 Linking ${desc} (${target} → ${source})"
ln -s -F -f -h "${source}" "${target}"
}
config_dir="${XDG_CONFIG_HOME:-$HOME/.config}"
mkdir_log "${config_dir}/git"
link "${dotfiles_dir}/git-config" "${config_dir}/git/config" "Git Config File"
link "${dotfiles_dir}/git-global-ignore" "${config_dir}/git/global_gitignore" "Git Global Ignore File"
link "${dotfiles_dir}/isovalent/git-config" "${config_dir}/git/isovalent-config" "Git Isovalent Settings File"
mkdir_log "${HOME}/.gnupg"
link "${dotfiles_dir}/gpg-agent.conf" "${HOME}/.gnupg/gpg-agent.conf" "GNUPG Settings File"
mkdir_log "${config_dir}/alacritty"
link "${dotfiles_dir}/alacritty.toml" "${config_dir}/alacritty/alacritty.toml" "Alacritty Config File"
link "${dotfiles_dir}/alacritty-dracula-theme.toml" "${config_dir}/alacritty/dracula-theme.toml" "Alacritty 'Dracula' Theme File"
link "${dotfiles_dir}/nvim" "${config_dir}/nvim" "Neovim Config Directory"
link "${dotfiles_dir}/fish" "${config_dir}/fish/" "Fish Config Directory"
link "${dotfiles_dir}/starship.toml" "${config_dir}/starship.toml" "Starship Config File"
echo "🚀 Done"