-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
55 lines (43 loc) · 2.31 KB
/
Makefile
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
SHELL := /bin/bash
default:
@echo "Cowardly refusing to run on $(shell uname). Use platform specific targets."
brew-install:
/bin/bash -c "$$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew-bundle:
/opt/homebrew/bin/brew shellenv > /tmp/brew-shell.env
source /tmp/brew-shell.env && which brew && brew update && brew bundle
macos:
sh .macos
osascript -e 'tell app "loginwindow" to «event aevtrrst»'
macos-reset-dock:
defaults write com.apple.dock persistent-apps -array
killall Dock
link-dotfiles:
mkdir -p $$HOME/.local
./link-dotfiles.sh
link-karabiner:
# don't link entire .config directory because it may contain secrets
mkdir -p $$HOME/.config
ln -s $$PWD/karabiner $$HOME/.config/karabiner
link-sublime:
git clone https://github.com/nonrational/sublime3 $$HOME/.sublime3
rm -rf $$HOME/Library/Application\ Support/Sublime\ Text
ln -s $$HOME/.sublime3 $$HOME/Library/Application\ Support/Sublime\ Text
backup-preferences:
cp $$HOME/Library/Preferences/com.googlecode.iterm2.plist $$PWD/etc/com.googlecode.iterm2.plist
cp $$HOME/Library/Containers/com.if.Amphetamine/Data/Library/Preferences/com.if.Amphetamine.plist $$PWD/etc/com.if.Amphetamine.plist
defaults export com.manytricks.Moom $$PWD/etc/com.manytricks.Moom.plist
restore-preferences:
@mkdir -p $$HOME/Library/Preferences/
cp $$PWD/etc/com.googlecode.iterm2.plist $$HOME/Library/Preferences/com.googlecode.iterm2.plist
@mkdir -p $$HOME/Library/Containers/com.if.Amphetamine/Data/Library/Preferences/
cp $$PWD/etc/com.if.Amphetamine.plist $$HOME/Library/Containers/com.if.Amphetamine/Data/Library/Preferences/com.if.Amphetamine.plist
defaults import com.manytricks.Moom $$PWD/etc/com.manytricks.Moom.plist
macos-disable-restore-apps-on-login:
# See https://apple.stackexchange.com/a/322787
# clear the file if it isn't empty
find ~/Library/Preferences/ByHost/ -name 'com.apple.loginwindow*' ! -size 0 -exec tee {} \; < /dev/null
# set the user immutable flag
find ~/Library/Preferences/ByHost/ -name 'com.apple.loginwindow*' -exec chflags uimmutable {} \;
# grep '^\w' Makefile | sed 's/:.*//g' | tr '\n' ' ' | pbcopy
.PHONY: default macos-setup init-post-reboot brew-install brew-bundle macos-reset-dock macos link-dotfiles link-karabiner link-sublime backup-preferences restore-preferences disable-restore-apps-on-login