Recently a screenshot of my MacOS rice blew up on X (formerly Twitter), eventually becoming my most liked post of all time.
I've been asked a lot about my setup, so I decided to write a blog post about it.
Window Manager
There's only one decent tiling window manager for MacOS, and that's yabai. It allows you to control your windows and spaces by using a CLI, for which you can set hotkeys using skhd. yabai is a tiling window manager, which means it automatically arranges and resizes your open application windows in a non-overlapping manner. It allows you to move and manipulate windows in various ways, including moving windows to different spaces and changing the layout of spaces along with a whole lot of other features.
It's probably not as good as some of the amazing window managers available for Linux such as bspwm or hyprland but it works and I haven't had any problems with it so far.
To install yabai, go through the yabai wiki.
Here's my yabai config:
# ~/.config/yabai/yabairc
# bsp, stack or float
yabai -m config layout bsp
yabai -m config window_placement second_child
# padding
yabai -m config window_gap 12
yabai -m config top_padding 4
yabai -m config bottom_padding 4
yabai -m config right_padding 4
yabai -m config left_padding 4
# mouse settings
yabai -m config mouse_follows_focus on
yabai -m config mouse_modifier alt
# left click and drag
yabai -m config mouse_action1 move
# right click and drag
yabai -m config mouse_action2 resize
yabai -m config mouse_drop_action swap
# disable yabai for these apps
yabai -m rule --add app="^Discord$" manage=off
Hotkey Daemon
yabai is usally paired with skhd which is an excellent hotkey daemon for MacOS. It utilizes a very simple DSL to define hotkeys. Using skhd, you can setup hotkeys for quickly executing yabai commands.
To install skhd follow this guide.
Here's my skhd config:
# ~/.config/skhd/skhdrc
# start and stop
ctrl + alt - q: yabai --stop-service
ctrl + alt - s: yabai --start-service
# changing window focus
alt - s: yabai -m window --focus south
alt - w: yabai -m window --focus north
alt - a: yabai -m window --focus west
alt - d: yabai -m window --focus east
# rotate layout clockwise
shift + alt - c: yabai -m space --rotate 270
# rotate layout anti-clockwise
shift + alt - a: yabai -m space --rotate 270
# flip alone x-axis
shift + alt - x: yabai -m space -- mirror x-axis
# flip along y-axis
shift + alt - y: yabai -m space --mirror y-axis
# toggle window float
shift + alt - t: yabai -m window --toggle float --grid 4:4:1:1:2:2
# maximize a window
shift + alt - m: yabai -m window --toggle zoom-fullscreen
# reset window size
shift + alt - e: yabai -m space --balance
# swap windows
shift + alt - h: yabai -m window --swap west
shift + alt - j: yabai -m window --swap south
shift + alt - k: yabai -m window --swap north
shift + alt - l: yabai -m window --swap east
# move window and split
ctrl + alt - h: yabai -m window --warp west
ctrl + alt - j: yabai -m window --warp south
ctrl + alt - k: yabai -m window --warp north
ctrl + alt - l: yabai -m window --warp east
I typically use vim keybindings for most things, but here I make one execption when it comes to changing window focus. I find it more convenient to use the wasd
keys for this purpose because they're closer to the left option
key.
Terminal Emulator
I use Alacritty as my terminal. It's super fast and customizable. I have written about it in my previous blog posts as well. Since then my configuration has udpated and now I have a pretty minimal yet aesthetic config.
# ~/.config/alacritty/alacritty.yml
env:
TERM: xterm-256color
font:
size: 14
normal:
family: "Dank Mono"
style: Regular
bold:
style: Bold
italic:
style: Italic
bold_italic:
style: Bold Italic
window:
option_as_alt: Both
# Window padding (changes require restart)
#
# Blank space added around the window in pixels. This padding is not scaled by
# DPI and the specified value is always added at both opposing sides.
padding:
x: 12
y: 12
# Spread additional padding evenly around the terminal content.
dynamic_padding: false
# Window decorations
decorations: buttonless
#
# Startup Mode (changes require restart)
#
# Values for `startup_mode`:
# - Windowed
# - Maximized
# - Fullscreen
#
# Values for `startup_mode` (macOS only):
# - SimpleFullscreen
startup_mode: Windowed
# Background opacity
opacity: 1
# Colors (Mellow)
colors:
# Default colors
primary:
background: "#161617"
foreground: "#c9c7cd"
# Cursor colors
cursor:
text: "#c9c7cd"
cursor: "#757581"
# Normal colors
normal:
black: "#27272a"
red: "#f5a191"
green: "#90b99f"
yellow: "#e6b99d"
blue: "#aca1cf"
magenta: "#e29eca"
cyan: "#ea83a5"
white: "#c1c0d4"
# Bright colors
bright:
black: "#353539"
red: "#ffae9f"
green: "#9dc6ac"
yellow: "#f0c5a9"
blue: "#b9aeda"
magenta: "#ecaad6"
cyan: "#f591b2"
white: "#cac9dd"
Editor
Dont't worry, I still primarily use VSCode for anything serious, but I did create a new Neovim configuration from scratch which I don't plan on updating frequently. I kept it quite minimal and used very few plugins. Here's Neovim and VSCode side by side.
Conclusion
This isn't a blog post I necessarily wanted to write but I kind of had to because the X post blew up. Hopefully it serves you as a good reference for configuring your Mac.