-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmac.sh
executable file
·76 lines (69 loc) · 2.44 KB
/
mac.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
#!/bin/zsh
SCRIPT_DIR=$(dirname "$(realpath "$0")")
source "${SCRIPT_DIR}/print.sh"
if ! command -v brew &> /dev/null; then
if [ -f "/usr/local/bin/brew" ]; then
BREW_BIN="/usr/local/bin/brew"
else
BREW_BIN="/opt/homebrew/bin/brew"
fi
print_progress "Installing Brew packages..."
$BREW_BIN tap "homebrew/bundle"
$BREW_BIN bundle
$($BREW_BIN --prefix)/opt/fzf/install --all
else
print_info "Brew bundled"
fi
if [ -d ~/Library/Application\ Support/Amethyst/ ]; then
if ! [ -f ~/Library/Preferences/com.amethyst.Amethyst.plist ]; then
print_progress "Copying Amethyst config file..."
cp -rf ./app_configs/amethyst/com.amethyst.Amethyst.plist ~/Library/Preferences/com.amethyst.Amethyst.plist
track_change
else
print_info "Amethyst config file is copied"
fi
if ! [ -f ~/Library/Application\ Support/Amethyst/Layouts/uniform-columns.js ]; then
print_progress "Copying Amethyst custom layout file..."
cp -rf ./app_configs/amethyst/uniform-columns.js ~/Library/Application\ Support/Amethyst/Layouts/uniform-columns.js
track_change
else
print_info "Amethyst custom layout file is copied"
fi
else
print_warning "Amethyst not installed"
fi
if ! [ -f ~/Library/Application\ Support/lazygit/config.yml ]; then
print_progress "Copying lazygit config file..."
sudo cp -rf ./app_configs/lazygit.config.yml ~/Library/Application\ Support/lazygit/config.yml
track_change
else
print_info "lazygit config file is copied"
fi
if ! [ -f ~/Library/LaunchAgents/pbcopy.plist ]; then
read -r "response?Do you want to setup pbcopy/pbpaste launch agents? (y/N) "
echo -e "\033[1A\033[2K\033[1A"
if [[ "$response" =~ ^[Yy]$ ]]; then
print_progress "Copying launch agent config files..."
cp app_configs/pbcopy.plist ~/Library/LaunchAgents/.
cp app_configs/pbpaste.plist ~/Library/LaunchAgents/.
launchctl load ~/Library/LaunchAgents/pbcopy.plist
launchctl load ~/Library/LaunchAgents/pbpaste.plist
track_change
else
print_warning "Skipping launch agent setup"
fi
else
print_info "launch agent config files are copied"
fi
if [ -f ~/.gnupg/gpg-agent.conf ]; then
if cat ~/.gnupg/gpg-agent.conf | grep -q pinentry-mac; then
print_info "pinentry-mac is already set"
else
print_progress "Setting pinentry-mac..."
touch ~/.gnupg/gpg-agent.conf
echo "pinentry-program $(which pinentry-mac)" | tee ~/.gnupg/gpg-agent.conf
track_change
fi
else
print_warning "gpg-agent not setup"
fi