Skip to content

Commit 7f32057

Browse files
committed
Fix make fonts, share fonts in /usr/local/Fonts across users
1 parent a133f01 commit 7f32057

1 file changed

Lines changed: 30 additions & 20 deletions

File tree

Makefile

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ CASK = /usr/local/bin/brew cask
1414
# restore .gnupg to decrypt the secrets from this repository
1515
# setup ssh config (relies on decrypted repository)
1616
bootstrap: \
17+
bootstrap-fonts-directory \
1718
bash \
1819
tmux \
1920
dotfiles \
@@ -24,6 +25,8 @@ bootstrap: \
2425

2526
bootstrap-administrator: \
2627
bootstrap-binary-user \
28+
bootstrap-homebrew-folder \
29+
bootstrap-fonts-directory \
2730
bash \
2831
tmux \
2932
casks-baseline \
@@ -46,13 +49,14 @@ bootstrap-binary-user:
4649
bootstrap-homebrew-folder:
4750
test -d /usr/local/Caches || sudo mkdir /usr/local/Caches
4851
test -d /usr/local/Logs/Homebrew || sudo mkdir -p /usr/local/Logs/Homebrew
52+
test -d /usr/local/Fonts || sudo mkdir /usr/local/Fonts
4953
sudo chown root:staff /usr/local/Logs
5054
sudo chmod g+w /usr/local/Logs
5155
# The binary user + group own everything around homebrew.
5256
# The administrative user is member of the binary group, hence he can use brew directly.
53-
sudo chown -R binary:binary /usr/local/{Caches,Caskroom,Cellar,Frameworks,Homebrew,Logs/Homebrew,bin,etc,include,lib,opt,sbin,share,var}
57+
sudo chown -R binary:binary /usr/local/{Fonts,Caches,Caskroom,Cellar,Frameworks,Homebrew,Logs/Homebrew,bin,etc,include,lib,opt,sbin,share,var}
5458
# Set the proper ACLs on the Homebrew folders in order to inherit ACLs
55-
sudo chmod g+w /usr/local/{Caches,Caskroom,Cellar,Frameworks,Homebrew,Logs/Homebrew,bin,etc,include,lib,opt,sbin,share,var}
59+
sudo chmod g+w /usr/local/{Fonts,Caches,Caskroom,Cellar,Frameworks,Homebrew,Logs/Homebrew,bin,etc,include,lib,opt,sbin,share,var}
5660
sudo chmod +a "group:_binary allow list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,file_inherit,directory_inherit" /usr/local/{Caches,Caskroom,Cellar,Frameworks,Homebrew,Logs/Homebrew,bin,etc,include,lib,opt,sbin,share,var}
5761

5862
brew-itself: /usr/local/bin/brew
@@ -183,10 +187,16 @@ casks-work: casks-itself
183187
# tableplus is the best graphical multi-database client
184188
$(CASK) install tableplus
185189

190+
bootstrap-fonts-directory:
191+
# Share user fonts via /usr/local
192+
chmod -a "group:everyone deny delete" ~/Library/Fonts || echo "No ACL present"
193+
rm -rf ~/Library/Fonts
194+
ln -svf /usr/local/Fonts ~/Library/Fonts
195+
186196
fonts: \
187197
casks-itself
188198
# tap homebrew-fonts to install freely available fonts
189-
$(BREW) tap caskroom/fonts
199+
$(BREW) tap homebrew/cask-fonts
190200
# install IBM Plex, an excellent modern font (https://www.ibm.com/plex/)
191201
$(CASK) install font-ibm-plex
192202
# install Adobe Source Code Pro, an excellent mono space font for programming
@@ -260,8 +270,8 @@ tmux: \
260270
$(BREW) install reattach-to-user-namespace
261271

262272
defaults: \
263-
defaults-Trackpad \
264-
defaults-Terminal \
273+
defaults-Trackpad \
274+
defaults-Terminal \
265275
defaults-Dock \
266276
defaults-NSGlobalDomain \
267277
defaults-Calendar
@@ -304,15 +314,15 @@ defaults: \
304314
# Require password immediately after 5 seconds on sleep or screen saver begins
305315
defaults write com.apple.screensaver askForPassword -int 1
306316
defaults write com.apple.screensaver askForPasswordDelay -int 5
307-
# Disable Game Center
308-
defaults write com.apple.gamed Disabled -bool true
317+
# Disable Game Center
318+
defaults write com.apple.gamed Disabled -bool true
309319
# Show the ~/Library folder
310320
chflags nohidden ~/Library
311321
# Keep this bit last
312322
# Kill affected applications
313323
for app in Safari Finder Mail SystemUIServer; do killall "$$app" >/dev/null 2>&1; done
314324
# Re-enable subpixel aliases that got disabled by default in Mojave
315-
defaults write -g CGFontRenderingFontSmoothingDisabled -bool false
325+
defaults write -g CGFontRenderingFontSmoothingDisabled -bool false
316326

317327
defaults-administrator:
318328
# disable apple captive portal (seucrity issue)
@@ -375,16 +385,16 @@ defaults-NSGlobalDomain:
375385
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
376386
# Disable smart dashes as they’re annoying when typing code
377387
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
378-
# Finder: show all filename extensions
379-
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
388+
# Finder: show all filename extensions
389+
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
380390

381391
defaults-Trackpad:
382392
# Trackpad: enable tap to click for this user and for the login screen
383393
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
384394
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
385395
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
386-
# Enable three-finger dragging
387-
defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerDrag -int 1
396+
# Enable three-finger dragging
397+
defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerDrag -int 1
388398

389399
defaults-Calendar:
390400
# Show week numbers (10.8 only)
@@ -397,14 +407,14 @@ defaults-Calendar:
397407
defaults write com.apple.iCal "Show time in Month View" -bool true
398408

399409
defaults-Terminal:
400-
# Only use UTF-8 in Terminal.app
401-
defaults write com.apple.terminal StringEncodings -array 4
402-
# Set the default shell
403-
defaults write com.apple.terminal Shell -string "/usr/local/bin/bash"
404-
# Open new windows with our own Theme
405-
plutil -replace "Window Settings"."Pro-gramming" -xml "$$(cat Pro-gramming.terminal)" ~/Library/Preferences/com.apple.Terminal.plist
406-
defaults write com.apple.Terminal "Default Window Settings" -string "Pro-gramming"
407-
defaults write com.apple.Terminal "Startup Window Settings" -string "Pro-gramming"
410+
# Only use UTF-8 in Terminal.app
411+
defaults write com.apple.terminal StringEncodings -array 4
412+
# Set the default shell
413+
defaults write com.apple.terminal Shell -string "/usr/local/bin/bash"
414+
# Open new windows with our own Theme
415+
plutil -replace "Window Settings"."Pro-gramming" -xml "$$(cat Pro-gramming.terminal)" ~/Library/Preferences/com.apple.Terminal.plist
416+
defaults write com.apple.Terminal "Default Window Settings" -string "Pro-gramming"
417+
defaults write com.apple.Terminal "Startup Window Settings" -string "Pro-gramming"
408418

409419
dotfiles: \
410420
$(DOTFILES) \

0 commit comments

Comments
 (0)