-
Notifications
You must be signed in to change notification settings - Fork 1
/
macos.mk
64 lines (53 loc) · 2.04 KB
/
macos.mk
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
# -----------------------------------------------------------------------------
# Makefile for macOS
# -----------------------------------------------------------------------------
define MSG_UPDATE_SHELLS
$(PURPLE)In order to add zsh to list of acceptable shells,
please execute the following commands:$(RESET)
$(WHITE)
sudo -s
sudo echo $$(brew --prefix)/bin/zsh >> /etc/shells
exit
$(RESET)
$(PURPLE)In order to use zsh as default shell,
please execute the following commands:$(RESET)
$(WHITE)
chsh -s $$(brew --prefix)/bin/zsh
$(RESET)
endef
# Checks that zsh (brew version) is in the acceptable shells list.
zsh-check: export MSG_UPDATE_SHELLS := $(MSG_UPDATE_SHELLS)
zsh-check:
@[ $$SHELL = "$$(brew --prefix)/bin/zsh" ] && \
($(GNU_GREP) -qx $$(brew --prefix)/bin/zsh /etc/shells || echo "$$MSG_UPDATE_SHELLS")
.PHONY: zsh-check
# Activate zsh as default shell.
zsh-activate:
command -v zsh | sudo tee -a /etc/shells
chsh -s $$(brew --prefix)/bin/zsh
.PHONY: zsh-activate
# -----------------------------------------------------------------------------
# Target: Setup macOS device.
# -----------------------------------------------------------------------------
setup:: apps-setup-homebrew
.PHONY: setup
install:: apps-setup-homebrew
.PHONY: install
cleanup::
@$(call cmd_exists,brew) && brew $(_DRY_RUN) cleanup
.PHONY: cleanup
# -----------------------------------------------------------------------------
# Target: Applications
# -----------------------------------------------------------------------------
## Apply a fancy dark icon to Kitty.
icon-kitty-dark:
@cp ./kitty/assets/kitty-dark.icns "$$(mdfind kMDItemCFBundleIdentifier = 'net.kovidgoyal.kitty')/Contents/Resources/kitty.icns"
@rm /var/folders/*/*/*/com.apple.dock.iconcache
@killall Dock
.PHONY: icon-kitty-dark
## Apply a fancy light icon to Kitty.
icon-kitty-light:
@cp ./kitty/assets/kitty-light.icns "$$(mdfind kMDItemCFBundleIdentifier = 'net.kovidgoyal.kitty')/Contents/Resources/kitty.icns"
@rm /var/folders/*/*/*/com.apple.dock.iconcache
@killall Dock
.PHONY: icon-kitty-light