-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·102 lines (83 loc) · 2.44 KB
/
install
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
#!/bin/sh
set -eu
# git
dir="$HOME/.config/git"
mkdir -p "$dir"
ln -sf "$PWD/gitconfig" "$dir/config"
ln -sf "$PWD/gitignore" "$dir/ignore"
# fish
dir="$HOME/.config/fish"
mkdir -p "$dir"
ln -sf "$PWD/config.fish" "$dir"
ln -sf "$PWD/fish_plugins" "$dir"
# nvim
dir="$HOME/.config/nvim"
mkdir -p "$dir"
ln -sf "$PWD/init.lua" "$dir"
# tmux
dir="$HOME/.config/tmux"
mkdir -p "$dir"
ln -sf "$PWD/tmux.conf" "$dir"
# htop
dir="$HOME/.config/htop"
mkdir -p "$dir"
ln -sf "$PWD/htoprc" "$dir"
# editorconfig
ln -sf "$PWD/.editorconfig" "$HOME"
# /usr/local/bin
for file in bin/*; do
sudo ln -sf "$PWD/$file" /usr/local/bin
done
# Alacritty
dir="$HOME/.config/alacritty"
mkdir -p "$dir"
ln -sf "$PWD/alacritty.toml" "$dir"
# LibreWolf
dir="$HOME/.librewolf"
mkdir -p "$dir"
ln -sf "$PWD/librewolf.overrides.cfg" "$dir"
# Sublime Text
dir="$HOME/Library/Application Support/Sublime Text/Packages/User"
mkdir -p "$dir"
ln -sf "$PWD/Preferences.sublime-settings" "$dir"
# Obsidian
dir="$HOME/wiki/.obsidian"
mkdir -p "$dir/snippets"
for file in obsidian/*.json; do
ln -sf "$PWD/$file" "$dir"
done
ln -sf "$PWD/obsidian/styles.css" "$dir/snippets"
install_terminal_themes() {
light_theme="nvim-light"
dark_theme="nvim-dark"
dir="$HOME/.config/alacritty"
curl -so "$dir/$light_theme.toml" https://raw.githubusercontent.com/nshern/neovim-default-colorscheme-extras/main/extras/alacritty/nvim-light.toml
curl -so "$dir/$dark_theme.toml" https://raw.githubusercontent.com/nshern/neovim-default-colorscheme-extras/main/extras/alacritty/nvim-dark.toml
echo "import = [ \"$dir/$light_theme.toml\" ]" > "$dir/theme.toml"
}
install_terminal_themes
# macOS
if [ "$(uname)" = "Darwin" ]; then
cd macOS
# TODO: defaults
# brew
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
/opt/homebrew/bin/brew bundle install --file=Brewfile
# fish
if [ "$SHELL" != "/opt/homebrew/bin/fish" ]; then
sudo chsh -s /opt/homebrew/bin/fish $USER
fi
# TODO: install fisher
# Karabiner-Elements
dir="$HOME/.config/karabiner/assets/complex_modifications"
mkdir -p "$dir"
ln -sf "$PWD/karabiner.json" "$dir"
# launchd
# NOTE: symlinks do not work on Sonoma
for file in LaunchAgents/*.plist; do
sed "s|\$HOME|$HOME|" "$file" > "$HOME/Library/$file"
done
for file in LaunchDaemons/*.plist; do
sudo cp -f "$file" "/Library/LaunchDaemons"
done
fi