cat >> ~/.ssh/config <<EOF
Host *
IdentityFile ~/.ssh/id_rsa
AddKeysToAgent yes
EOFmkdir -p ~/Projects
git clone git@github.com:tungd/dotfiles-lean.git ~/Projects/dotfilesmkdir -p ~/.local/bin
ln -s ~/Projects/dotfiles/.bash_profile ~/.bash_profile
ln -s ~/Projects/dotfiles/.bashrc ~/.bashrc
ln -s ~/Projects/dotfiles/.emacs.d ~/.emacs.d
ln -s ~/Projects/dotfiles/.gitconfig ~/.gitconfig
ln -s ~/Projects/dotfiles/.npmrc ~/.npmrc
ln -s ~/Projects/dotfiles/.eslintrc ~/.eslintrcxcode-select --installGlobal CLI tools are managed by MacPorts again. The Makefile keeps the common package set and custom Emacs port wired together:
make macportsLocal ports live in this repo under ports/, but MacPorts reads them from a
mirror outside $HOME so its macports build user can access them:
sudo mkdir -p /opt/local/var/macports/sources/local
sudo cp -R /Users/tung/Projects/dotfiles/ports /opt/local/var/macports/sources/local/dotfiles-ports
sudo chown -R tung:staff /opt/local/var/macports/sources/local/dotfiles-portsAdd this source before the default source in
/opt/local/etc/macports/sources.conf:
file:///opt/local/var/macports/sources/local/dotfiles-ports [nosync]
rsync://rsync.macports.org/macports/release/tarballs/ports.tar.gz [default]After that, make emacs-weekly keeps the mirror updated with rsync and
reruns portindex there.
The weekly Emacs build is managed through the local MacPorts port under
ports/editors/emacs:
make emacs-weeklycd /tmp
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/mac_arm64/sessionmanager-bundle.zip" -o "sessionmanager-bundle.zip"
unzip sessionmanager-bundle.zip
./sessionmanager-bundle/install -i ~/.local/lib/aws-ssm -b ~/.local/bin/session-manager-plugincurl -L https://raw.githubusercontent.com/qoomon/aws-ssm-ec2-proxy-command/master/aws-ssm-ec2-proxy-command.sh -o ~/.local/aws-ssm-ec2-proxy-command.sh
chmod +x ~/.local/aws-ssm-ec2-proxy-command.shcat >> ~/.ssh/config <<EOF
Host i-* mi-*
IdentityFile ~/.ssh/id_rsa
ProxyCommand aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'
StrictHostKeyChecking no
EOFDecrease repeat delay, increase repeat rate and disable Emoji.
defaults write -g ApplePressAndHoldEnabled -bool false
# defaults write -g InitialKeyRepeat -int 10
defaults write -g KeyRepeat -int 1
defaults write -g NSUserKeyEquivalents -dict-add 'Emoji & Symbols' '@^j'defaults write com.apple.screencapture disable-shadow -bool trueManaged windows use five awesome-style Space labels: home, code, web,
comm, and misc. Layouts are bsp for home and comm, stack for
code and web, and float for misc. All spaces use 2px padding and no
window shadows. skhd binds Option-1..5 to switch spaces,
Option-Shift-1..5 to move windows, and Option-j/k to cycle windows.
Rules place Ghostty on home, Emacs on code, browsers on web, chat apps
on comm, office/media apps on misc, and float common system/dialog windows.
sudo port install yabai skhd
sudo codesign -fs 'yabai-cert' /opt/local/bin/yabai
ln -sfn ~/Projects/dotfiles/.yabairc ~/.yabairc
ln -sfn ~/Projects/dotfiles/.skhdrc ~/.skhdrc
chmod +x ~/Projects/dotfiles/.yabairc
yabai --start-service
skhd --start-serviceCreate yabai-cert first in Keychain Access: System keychain, self-signed root,
Code Signing, and set Code Signing trust to Always Trust.
If yabai exits with could not access accessibility features, enable
/opt/local/bin/yabai in System Settings -> Privacy & Security ->
Accessibility. If it is already listed, remove it with - and add it again
after signing. Then run:
yabai --restart-serviceThis yabai build does not support built-in focused-window borders. The
.yabairc starts borders automatically when installed:
brew tap FelixKratz/formulae
brew install borders
yabai --restart-serviceIf skhd asks for Accessibility, enable /opt/local/bin/skhd in System
Settings -> Privacy & Security -> Accessibility, then run:
skhd --restart-serviceDisable font-smoothing, works better with 2k external display (provided web pages are zoomed & editors uses medium fonts)
defaults -currentHost write -g AppleFontSmoothing -int 2git clone https://github.com/jdtsmith/emacs-mac.git
cd emacs-macs
./autogen.sh
CFLAGS="-O3 -mcpu=native -mtune=native -fomit-frame-pointer -DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT" ./configure --with-native-compilation=aot --with-tree-sitter --enable-mac-app=yes --prefix=$HOME/.local --with-modules --enable-mac-self-contained --without-dbus
make -j10
cp -R native-lisp mac/Emacs.app/Contents
make install
cp -R mac/Emacs.app ~/Applications