-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·82 lines (60 loc) · 2.49 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
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/sh
: "${XDG_CONFIG_HOME:="$HOME"/.config}"
: "${XDG_DATA_HOME:="$HOME"/.local/share}"
setup_links() {
mkdir -p "$XDG_CONFIG_HOME"/ghostty
ln -sf "$PWD"/ghosttyconfig.txt "$XDG_CONFIG_HOME"/ghostty/config
mkdir -p "$XDG_CONFIG_HOME"/git
ln -sf "$PWD"/gitconfig.ini "$XDG_CONFIG_HOME"/git/config
mkdir -p "$HOME"/.hammerspoon
ln -sf "$PWD"/hammerspoon.lua "$HOME"/.hammerspoon/init.lua
mkdir -p "$XDG_CONFIG_HOME"/jj/config.d
ln -sf "$PWD"/jjconfig.toml "$XDG_CONFIG_HOME"/jj/config.d/00.base.toml
mkdir -p "$XDG_CONFIG_HOME"/kak
ln -sf "$PWD"/kakrc.kak "$XDG_CONFIG_HOME"/kak/kakrc
mkdir -p "$XDG_CONFIG_HOME"/oils
ln -sf "$PWD"/oshrc.sh "$XDG_CONFIG_HOME"/oils/oshrc
mkdir -p "$XDG_CONFIG_HOME"/tmux
ln -sf "$PWD"/tmux.conf "$XDG_CONFIG_HOME"/tmux/tmux.conf
mkdir -p "$HOME"/.qutebrowser
ln -sf "$PWD"/qutebrowser/config.py "$HOME"/.qutebrowser/config.py
mkdir -p "$XDG_CONFIG_HOME"/zsh
ln -sf "$PWD"/zsh/zshenv.zsh "$HOME"/.zshenv
ln -sf "$PWD"/zsh/zshrc.zsh "$XDG_CONFIG_HOME"/zsh/.zshrc
if [ "$(uname -s)" = 'Darwin' ]; then
mkdir -p "$HOME"/Library/LaunchAgents
ln -sf "$PWD"/LaunchAgents/local.KeyRemapping.plist "$HOME"/Library/LaunchAgents/local.KeyRemapping.plist
fi
}
setup_homebrew() {
brew bundle install --file="$PWD"/packages/Brewfile.rb --no-lock --no-upgrade
}
setup_macos() {
# Appearance: Show scroll bars
sudo defaults write -globalDomain AppleShowScrollBars -string 'Always'
# Display: Reduce transparency
sudo defaults write com.apple.universalaccess reduceTransparency -bool true
# Keyboard: Key repeat rate
sudo defaults write -globalDomain KeyRepeat -int 2
# Keyboard: Delay until repeat
sudo defaults write -globalDomain InitialKeyRepeat -int 15
}
setup_apk() {
printf 'https://dl-cdn.alpinelinux.org/alpine/edge/main\n' | sudo tee /etc/apk/repositories >/dev/null
printf 'https://dl-cdn.alpinelinux.org/alpine/edge/community\n' | sudo tee -a /etc/apk/repositories >/dev/null
printf 'https://dl-cdn.alpinelinux.org/alpine/edge/testing\n' | sudo tee -a /etc/apk/repositories >/dev/null
cat "$PWD"/packages/apk.txt | xargs sudo apk add
if [ ! -d "$XDG_DATA_HOME"/bun ]; then
curl -fsSL https://bun.sh/install | BUN_INSTALL="$XDG_DATA_HOME"/bun osh
fi
}
if [ -x "$(command -v brew)" ]; then
setup_homebrew
fi
if [ -x "$(command -v apk)" ]; then
setup_apk
fi
if [ "$(uname -s)" = 'Darwin' ]; then
setup_macos
fi
setup_links