/Yabai.spoon

HammerSpoon Spoon for Yabai

Primary LanguageLua

Yabai.spoon

Screen.Recording.2024-09-15.at.9.13.49.PM.mov

A HammerSpoon Yabai integration which provides:

  1. UI Elements for adding, labeling, and navigating spaces.
  2. MenuBar icon displaying current space with drop down to select a space
  3. Clickable on-screen stack indicator
  4. MenuBar stack indicator and drop down for stack window selection
  5. Automatic empty space deletion

Usage

Follow directions for installing a Spoon on HammerSpoon's documentation.

Load it with defaults in your init.lua.

local yabai = hs.loadSpoon('Yabai')
yabai:bindHotkeys(nil)
yabai:configure(nil)
yabai:start()

Configuration

Config

local defaultConfig = {
	showSpaceMenuBarIcon = true,
	cleanEmptySpaces = true,
	showOnScreenStackIndicator = true,
	showStackIndicatorMenuBarIcon = true
}

spaceMenuBarIcon - Show the MenuBar icon with a drop down to select a space cleanEmptySpaces - Automatically delete empty spaces showOnScreenStackIndicator - Show the on-screen stack indicator showMenuBarStackIndicator - Show the MenuBar stack indicator

Keymaps

local defaultHotKeysMapping = {
	createSpace = { { "alt", "shift" }, "n" },
	selectSpace = { { "alt" }, "w" },
	labelSpace = { { "alt" }, "r" },
	toggleSpaceLayout = { { "alt" }, "o" }
}

Both configuration and keymaps can be overwritten on a per-key basis:

yabai:bindHotkeys({ createSpace = { { "alt", "shift" }, "x" } })
yabai:configure({ showSpaceMenuBarIcon = false })