-
Notifications
You must be signed in to change notification settings - Fork 0
/
_mac_init.sh
35 lines (31 loc) · 1.06 KB
/
_mac_init.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
#!/usr/bin/env bork
ok check "fdesetup status | grep $Q -E 'FileVault is (On|Off, but will be enabled after the next restart).'"
if check_failed && satisfying; then
echo "Enabling Filevault on Next Boot"
sudo fdesetup enable -user $USER | tee $HOME/Desktop/"Filevault Recovery Key.txt"
fi
if [ -n "$COMPUTER_NAME" ]; then
echo "Setting Computer name to $COMPUTER_NAME"
ok scutil ComputerName $COMPUTER_NAME
ok scutil HostName $COMPUTER_NAME
ok scutil LocalHostName $COMPUTER_NAME
fi
ok directory "$HOME/.ssh"
ok check "[ -e $HOME/.ssh/*.pub ]"
if check_failed && satisfying; then
echo "Generating SSH Key"
ssh-keygen -t rsa
fi
if satisfying
echo "Setting resolution of internal display to smallest HiDPI available, if possible"
ok cask switchresx
osascript << 'EOF'
tell application "SwitchResX Daemon"
set builtinDisplay to first item of (displays)
set highestRetinaMode to last item of (modes of builtinDisplay whose definition is 2.0)
if height of highestRetinaMode > 899 then
set current mode of builtinDisplay to highestRetinaMode
end if
end tell
EOF
end if