Skip to content

Instantly share code, notes, and snippets.

@dslaw
Last active October 22, 2021 14:47
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dslaw/9188f6cdbdf1de350472834c3c9f4d7b to your computer and use it in GitHub Desktop.
Save dslaw/9188f6cdbdf1de350472834c3c9f4d7b to your computer and use it in GitHub Desktop.
Setup for macOS
# open terminal
cmd - return : osascript -e 'tell application "iTerm" to create window with default profile'
# enter fullscreen mode for the focused container
# cmd + f clobbers text search in firefox.
shift + cmd - f : yabai -m window --toggle zoom-fullscreen
# kill focused window
shift + cmd - q : yabai -m window --close
# change focus
cmd - j : yabai -m window --focus west
cmd - l : yabai -m window --focus south
cmd - k : yabai -m window --focus north
cmd - 0x29 : yabai -m window --focus east
# move focused window
shift + cmd - j : yabai -m window --swap west
shift + cmd - l : yabai -m window --swap south
shift + cmd - k : yabai -m window --swap north
shift + cmd - 0x29 : yabai -m window --swap east
# rotate space
cmd - space : yabai -m space --rotate 90
# move focused container to workspace
shift + cmd - 1 : yabai -m window --space 1
shift + cmd - 2 : yabai -m window --space 2
shift + cmd - 3 : yabai -m window --space 3
shift + cmd - 4 : yabai -m window --space 4
shift + cmd - 5 : yabai -m window --space 5
shift + cmd - 6 : yabai -m window --space 6
#!/usr/bin/env bash
yabai -m config layout bsp
yabai -m config window_placement second_child
yabai -m config top_padding 15
yabai -m config bottom_padding 15
yabai -m config left_padding 15
yabai -m config right_padding 15
yabai -m config window_gap 15
yabai -m config focus_follows_mouse off
yabai -m config mouse_follows_focus off
  1. Create workspaces via Mission Control
    • Activate Mission Control (swipe three fingers on track pad up)
    • Add workspaces by clicking on the plus sign in the upper-right corner
  2. Add keyboard shortcuts to switch to created workspaces
    • System Preferences -> Keyboard -> Shortcuts -> Mission Control
    • Check the box next to relevant boxes. The shortcut can be edited by double clicking on it.
  3. Remap Caps Lock to Escape when pressed and Control when held
    • Using Karabiner-Elements
    • There's a guide on the internet somewhere
  4. Remap Option to CMD
    • Using Karabiner-Elements
    • Add a simple rule to map left_option to left_command
    • As option is in the place where super (Mod4) is, this maps to a "windows keyboard" better
  5. Install yabai and skhd
    • Using left CMD/Option as super
    • No idea what alt maps to
  6. Place config files for yabai and skhd under $HOME/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment