-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sh
148 lines (116 loc) · 3.77 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#! /bin/sh
step () {
final=$(echo "$@")
plus=$(expr ${#final} + 6)
printhashtags () {
for i in $(seq $plus); do
printf "#"
done
}
echo
printhashtags
echo "\n## $@ ##"
printhashtags
echo
}
step "Installing xcode command line tools if not already installed"
xcode-select -p &> /dev/null
if [ $? -ne 0 ]; then
echo "Xcode CLI tools not found. Installing them..."
touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress;
PROD=$(softwareupdate -l |
grep "\*.*Command Line" |
head -n 1 | awk -F"*" '{print $2}' |
sed -e 's/^ *//' |
tr -d '\n')
softwareupdate -i "$PROD" -v;
else
echo "'xcode command line tools' is already installed, you're set."
fi
step "Installing brew if not already installed"
if ! command -v brew &> /dev/null
then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/$(whoami)/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
else
echo "brew is already installed, you're set."
sleep 1
fi
install () {
if ! command -v "$@" &> /dev/null; then
brew install "$@"
else
echo "'$@' is already installed, you're set."
sleep 1
fi
}
step "Installing dependencies/apps/sketchybar if not already installed."
brew tap FelixKratz/formulae
install sketchybar
step "Installing dependencies/apps/borders if not already installed."
install borders
step "Tapping koekeishiya repo"
brew tap koekeishiya/formulae
step "Installing dependencies/apps/yabai if not already installed"
install yabai
step "Installing dependencies/apps/skhd if not already installed"
install skhd
step "Installing dependencies/apps/kitty if not already installed"
install --cask kitty
step "Installing dependencies/apps/jq if not already installed."
install jq
step "Installing dependencies/apps/btop if not already installed."
install btop
step "install wget"
install wget
step "Installing dependencies/shell/oh-my-zsh"
cd ~/
wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
sh install.sh --unattended
rm -rf install.sh
step "Installing dependencies/shell/starship if not already installed"
install starship
step "Tapping fonts repo"
brew tap homebrew/cask-fonts
step "Installing dependencies/fonts/hack-nerd-font"
brew install font-hack-nerd-font
step "Installing dependencies/fonts/sf-symbols-mono"
brew install --cask font-sf-mono
step "Installing dependencies/fonts/fira-code"
brew install --cask font-fira-code
step "Installing dependencies/fonts/symbols-only-nerd-font"
brew install --cask font-symbols-only-nerd-font
step "Installing dependencies/fonts/sf-symbols"
brew install --cask sf-symbols
step "Cloning the dotfiles repository"
git clone [email protected]:QuakeWang/dotfiles.git
step "Moving everything to the right place"
cd dotfiles
for dir in btop fastfetch kitty nvim sketchybar skhd yabai; do
mkdir -p ~/.config/$dir
cp -rf $dir/* ~/.config/$dir
echo "Moved $dir"
done
cp starship/starship.toml ~/.config/starship.toml
echo "Moved starship"
step "Hiding Dock and menu bar"
read -p "Is your dock currently hidden? (y/n)" dock_hide
if [ $dock_hide == "n" ]; then
osascript -e "tell application \"System Events\" to set the autohide of the dock preferences to true"
fi
read -p "Is your menu bar currently hidden? (y/n)" menu_hide
if [ $menu_hide == "n" ]; then
osascript -e 'tell application "System Events"
tell dock preferences to set autohide menu bar to not autohide menu bar
end tell'
fi
# start yabai
yabai --start-service
# start skhd
skhd --start-service
# start sketchybar
brew services start sketchybar
# start borders
brew services start borders
step "That's All, and enjoy it!"