-
Notifications
You must be signed in to change notification settings - Fork 1
/
mac.sh
92 lines (64 loc) · 2.2 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env bash
set -euo pipefail
# https://raw.githubusercontent.com/hejops/arch/master/mac.sh
# homebrew is avoided at all costs
build() {
:
# build: macports nvim conda xcode
# https://www.macports.org/install.php
# https://github.com/macports/macports-base/releases/download/v2.8.0/MacPorts-2.8.0-13-Ventura.pkg
# command -v port
# /opt/local/bin/port
# must redo after every system update...
xcode-select --install || :
# 'sudo xcodebuild -license' not required, apparently
}
# port: ranger lowdown shfmt npm? pcregrep pip? ack ag ripgrep exa ncdu fzf shellcheck
# these should be obtained via nvim-mason now
# pip: black
# npm i -g: prettier bash-language-server
dotfiles() {
# git config --global user.email [email protected]
# git config --global user.name Joseph
# TODO: better to set up ssh key(s)
if [[ ! -f "$HOME/.git-credentials" ]]; then
git config --global credential.helper store
echo "Setting up Github PAT..."
open "https://github.com/settings/tokens/new" > /dev/null
read -r -p "PAT: " PAT < /dev/tty
echo "https://hejops:[email protected]" |
tr -d ' ' |
tee "$HOME/.git-credentials"
fi
# get dotfiles and scripts
cd
git clone https://github.com/hejops/dotfiles
cd dotfiles
rm -rf "$HOME/.mozilla"
./install
# TODO: remove and stop tracking personal files:
# ~/.config/cron
# ~/.config/newsboat
# ~/.config/nicotine
# ~/.config/tridactyl/tridactylrc
# rm -r ~/dotfiles
# fonts dir: /Library/Fonts
# 1. get github token -- file transfer, or type manually
# 2. git config --global credential.helper store
# (else get password prompt, which is insecure/outdated)
# 3. git clone https://github.com/hejops/dotfiles
}
dock_settings() {
# removes nearly everything; the rest can be manually removed
# defaults write com.apple.dock persistent-apps '()'
# https://macos-defaults.com
defaults write com.apple.dock "orientation" -string "left"
defaults write com.apple.dock "show-recents" -bool "false"
defaults write com.apple.dock "static-only" -bool "true"
defaults write com.apple.dock "tilesize" -int "30"
# keyboard shortcuts: terminal / ranger / firefox
# autostart
# # disable startup sound
# sudo nvram StartupMute=%01
# reverse scroll direction
}