-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
386 lines (306 loc) · 19.4 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
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
#!/bin/bash
# Install xCode cli tools
echo "Installing commandline tools..."
xcode-select --install
# Installing Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Installing cargo Packages
cargo install oxker
cargo install git-cliff # Changelog file generator
# Install Brew
echo "Installing Brew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew analytics off
# Brew Taps
echo "Installing Brew Formulae..."
brew tap homebrew/cask-fonts # nerd fonts
brew tap FelixKratz/formulae # JankyBorders & Sketchybar
brew tap koekeishiya/formulae # yabai and skhd
brew tap noahgorstein/tap
# Brew Formulae
brew install llvm # compiler infrastructure
brew install ccls # c/c++ language server
brew install libomp # runtime library for llvm
brew install mas # mac app store cli
brew install tree # list directories in tree format
brew install wget # download from the interwebz
brew install jq # json processor
brew install gh # Github CLI
brew install rename # Perl-powered rename script
brew install neofetch # System info script
brew install ifstat # Network interface bandwidth
brew install starship # Cross shell prompt
brew install skhd # hotkey daemon for keybindings
brew install yabai # Tilling window manager
brew install sketchybar # status bar replacement
brew install sf-symbols # highly configurable symbols for apps
brew install switchaudio-osx # Audio switching CLI
brew install btop # System resource monitoring
brew install htop # System resource monitoring
brew install act # Run github actions locally
brew install speedtest # Internet speed testing CLI
brew install topgrade # System wide updates
brew install ssh-copy-id # Transfer SSH Public key to remote
brew install httpie # API requests from CLI
brew install openssl@3 # SSL/TLS Toolkit
brew install git # Distributed revision control system
brew install cmake # cross-platform make command
brew install lz4 # Extremely Fast Compression algorithm
brew install qemu # Emulator for x86 and PowerPC
brew install unzip # Extraction utility
brew install telnet # Interface for telnet protocol
brew install docker-completion # Shell completion for docker
brew install [email protected] # Python v3.11.5
brew install ncdu # File storage analyzer
brew install git-delta # Syntax highligting pager for git diff
brew install jqp # A TUI playground to experiment with jq
brew install tealdeer # Cheatsheets for CLI commands
brew install jq # YAML, JSON, XML, CSV, TOML processor
brew install tmuxp # tmux session manager
brew install btop # system resource monitoring
brew install gping # ping command but with a graph
brew install broot # Ultra pro Navigation
brew install eza # replacement for ls
brew install procs # modern replacement for ps
brew install zoxide # modern replacment for cd
brew install navi # cheat sheet module for the CLI
brew install onefetch # Information on current git repo
brew install howdoi # technical suggestions within your CLI
brew install weechat # Extensible IRC Client
brew install glow # markdown previews
brew install fx # Terminal JSON viewer & processor
brew install tokei # count your code
brew install trippy # Network diagnostics tool
brew install yt-dlp # Command-line downloader
brew install pueue # Shell command manager and task runner
brew install lnav # log file viewer and live streaming
brew install dog # command-line DNS Client
brew install ffmpeg # record, convert and stream audio/video data
brew install thefuck # Auto correct previously mistyped command
brew install cmatrix # matrix-like rainfall effect on CLI for the h4x0rs
brew install pgcli # postgres cli with autocomplete
brew install pspg # unix pager for long postgres, mysql or csv tables
brew install atuin # shell history enhancer
brew install doggo # Command-line DNS client
brew install yazi ffmpegthumbnailer unar jq poppler fd ripgrep fzf zoxide font-symbols-only-nerd-font # yazi command line file browser
# Terminal Setup
brew install tmux # Terminal multiplexer
brew install fd # alternative to find command
brew install fzf # Command-line fuzzy finder
brew install ripgrep # grep like features
brew install zsh # Unix shell
brew install zsh-vi-mode # vim mode plugin for zsh
brew install zsh-autosuggestions # unobstrusive suggestions for zsh
brew install zsh-syntax-highlighting # syntax-highlighting for zsh
brew install lazygit # Terminal UI for git
brew install nnn # Terminal file manager
brew install neovim # the OG ;)
brew install rclone # mount and sync cloud storages
brew install unikraft/cli/kraftkit # kraft a custom OS/Kernel
brew install hyperfine # CLI Benchmarking Tool
brew install trivy # Find vulnerabilities, misconfigurations, secrets, SBOM etc
brew install sniffnet # Internet Traffic Monitoring Tool
brew install --cask warp # AI enabled Terminal App
brew install --cask zed # AI enabled Code Editor
brew install secretive # Store SSH keys in the Secure Enclave
brew install oha # CLI Load testing tool for web services
brew install jesseduffield/lazydocker/lazydocker # Docker TUI
## Casks
echo "Installing Brew Casks..."
### Terminals & Browsers
brew install --cask alacritty
brew install --cask kitty
brew install --cask orion
### Nice to have
brew install --cask alfred
brew install --cask spotify
### Fonts
brew install --cask sf-symbols
brew install --cask font-hack-nerd-font
brew install --cask font-jetbrains-mono
brew install --cask font-fira-code
# Mac App Store Apps
echo "Installing Mac App Store Apps..."
mas install 497799835 #xCode
mas install 1480933944 #Vimari
mas install 1284863847 # Unsplash Wallpapers
mas install 937984704 # Amphetamine
mas install 6450280202 # Day Progress App
# Install Zotero 7 Research Assistant
curl -L -o Zotero-7.dmg "https://www.zotero.org/download/client/dl?channel=release&platform=macos&version=7.0" && hdiutil attach Zotero-7.dmg && cp -R /Volumes/Zotero/Zotero.app /Applications/ && hdiutil detach /Volumes/Zotero && rm Zotero-7.dmg
# Install Texts App for all IM services (whatsapp, telegram etc)
curl https://texts.com/i/h7N9qjFT27KBstdEp1LDzureJn1BFzQn8wBhkk4prM/anil.sh | sh
# Close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
sudo -v
# Python Packages
echo "Installing Python Packages..."
pip install dooit
pip install debugpy
pip install pynvim
pip install pyyaml
pip install arsenal-cli
# A recursive Internet Scanner Tool
pip install bbot
# npm packages
npm install -g better-commits
# macOS Settings
echo "Changing macOS defaults..."
# Close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
sudo -v
# Allows the Finder to browse all available network interfaces.
defaults write com.apple.NetworkBrowser BrowseAllInterfaces 1
# Prevents the creation of .DS_Store files on network volumes.
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Disables the option to have Spaces span multiple displays.
defaults write com.apple.spaces spans-displays -bool false
# Enables auto-hiding of the Dock.
defaults write com.apple.dock autohide -bool true
# Disables the most recently used Spaces feature in the Dock.
defaults write com.apple.dock "mru-spaces" -bool "false"
# Reverses the scroll direction.
defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
# Sets the keyboard key repeat rate to the fastest.
defaults write NSGlobalDomain KeyRepeat -int 1
# Shows file extensions in Finder.
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Hides the menu bar.
defaults write NSGlobalDomain _HIHideMenuBar -bool true
# Sets the highlight color.
defaults write NSGlobalDomain AppleHighlightColor -string "0.65098 0.85490 0.58431"
# Sets the accent color.
defaults write NSGlobalDomain AppleAccentColor -int 1
# Hides external hard drives on the desktop.
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool false
# Hides internal hard drives on the desktop.
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool false
# Hides mounted servers on the desktop.
defaults write com.apple.finder ShowMountedServersOnDesktop -bool false
# Hides removable media on the desktop.
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool false
# Shows hidden files in Finder.
defaults write com.apple.Finder AppleShowAllFiles -bool true
# Sets the default search scope to the current folder.
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# Disables the warning when changing a file extension.
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Shows the POSIX path in Finder window titles.
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# Sets the default Finder view style to list view.
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
# Hides the status bar in Finder.
defaults write com.apple.finder ShowStatusBar -bool false
# Enables developer extras globally.
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
# Excludes the sender's name when copying email addresses in Mail.
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
# Disable the sound effects on boot
sudo nvram SystemAudioVolume=" "
# Reveal IP address, hostname, OS version, etc. when clicking the clock
# in the login window
sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName
# Set a blazingly fast keyboard repeat rate
defaults write NSGlobalDomain KeyRepeat -int 1
defaults write NSGlobalDomain InitialKeyRepeat -int 10
# disable press and hold for special characters
defaults write -g ApplePressAndHoldEnabled -bool false
# stop hiding the ~/Library in finder
chflags nohidden ~/Library
# Set the timezone; see `sudo systemsetup -listtimezones` for other values
sudo systemsetup -settimezone "Asia/Kolkata" >/dev/null
# Finder: show path bar
defaults write com.apple.finder ShowPathbar -bool true
# Fonts setup
# Installing sketchybar-app-font
curl -L https://github.com/kvndrsslr/sketchybar-app-font/releases/download/v1.0.16/sketchybar-app-font.ttf -o $HOME/Library/Fonts/sketchybar-app-font.ttf
# Installing SFMono-Nerd-Font for neovim
git clone [email protected]:shaunsingh/SFMono-Nerd-Font-Ligaturized.git /tmp/SFMono_Nerd_Font
mv /tmp/SFMono_Nerd_Font/* $HOME/Library/Fonts
rm -rf /tmp/SFMono_Nerd_Font/
# Create backup of .config folder
# Set the source and destination paths
source_folder="$HOME/.config"
destination_folder="$HOME/backup"
# Create the destination folder if it doesn't exist
mkdir -p "$destination_folder"
# Get the current date for the backup filename
backup_date=$(date +"%Y%m%d_%H%M%S")
# Create the zip file with a timestamp
zip_filename="config_backup_$backup_date.zip"
zip_filepath="$destination_folder/$zip_filename"
# Zip the .config folder
zip -r "$zip_filepath" "$source_folder"
# Check if the zip operation was successful
if [ $? -eq 0 ]; then
echo "Backup successful. Zip file created at: $zip_filepath"
# Replace .config folder in $HOME with ones from the online repo
# Set the source repository URL
git_repo_url="[email protected]:anil-dewani/dotfiles.git"
# Set the target directory for git clone
clone_dir="/tmp/cloned_repo_dotfiles"
# Set the home directory
home_dir="$HOME"
# Set the folders to copy
folders_to_copy=("alacritty", "broot", "btop", "nvim", "sketchybar", "skhd", "tmux", "tmuxp", "yabai")
# Set the destination folder in the user's .config directory
destination_folder="$HOME/.config"
# Perform git clone
git clone "$git_repo_url" "$clone_dir"
# Check if git clone was successful
if [ $? -ne 0 ]; then
echo "Git clone failed. Exiting."
exit 1
fi
# Create the destination folder if it doesn't exist
mkdir -p "$destination_folder"
# Copy specified folders to the .config folder
for folder in "${folders_to_copy[@]}"; do
cp -r "$clone_dir/$folder" "$destination_folder"
done
# Copy dooit config into respective folder
dooit_config_location = $(python -c "import appdirs; print(appdirs.user_config_dir('dooit'))")
cp -r "$clone_dir/dooit" "$dooit_config_location"
# set the Wallpaper
# Specify the path to the wallpaper image
wallpaper_path="$clone_dir/wallpapers/midnightmountains.png"
# Set the wallpaper for all desktops
osascript -e "tell application \"Finder\" to set desktop picture to POSIX file \"$wallpaper_path\""
# Specify the paths to the new .gitconfig and .zshrc files
new_gitconfig_path="/path/to/your/new/.gitconfig"
new_zshrc_path="/path/to/your/new/.zshrc"
# Backup existing .gitconfig
if [ -e "$home_dir/.gitconfig" ]; then
mv "$home_dir/.gitconfig" "$home_dir/.gitconfig_backup_$(date +'%Y%m%d_%H%M%S')"
echo "Backup of .gitconfig created."
fi
# Backup existing .zshrc
if [ -e "$home_dir/.zshrc" ]; then
mv "$home_dir/.zshrc" "$home_dir/.zshrc_backup_$(date +'%Y%m%d_%H%M%S')"
echo "Backup of .zshrc created."
fi
# Copy the new .gitconfig and .zshrc files
cp "$clone_dir/.gitconfig" "$home_dir/.gitconfig"
cp "$clone_dir/.zshrc" "$home_dir/.zshrc"
echo "Replacement of .gitconfig and .zshrc completed."
# Clean up: remove the temporary clone directory
rm -rf "$clone_dir"
echo "Git clone and copy completed successfully."
else
echo "Backup failed. Please check for errors."
fi
# Start Services
echo "Starting Services (grant permissions)..."
brew services start skhd
brew services start yabai
# Authorise github CLI
gh auth login
csrutil status
echo "Do not forget to disable SIP"
echo "Add sudoer manually:\n '$(whoami) ALL = (root) NOPASSWD: sha256:$(shasum -a 256 $(which yabai) | awk "{print \$1;}") $(which yabai) --load-sa' to '/private/etc/sudoers.d/yabai'"
echo "Installation setup completed. Highly adviced to restart your system once."
sudo shutdown -r