4.1.7 • Published 14 days ago

yabai-master-stack-plugin v4.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
14 days ago

Yabai Master-Stack Plugin

npm version

A video of the Master-Stack plugin in action

Yabai is an amazing tiling manager for macOS. However, since the algorithm Yabai uses is based on bsp (binary-space partitioning), implementing layouts such as the master-stack layout in dwm is not within their goals for the project. Luckily, Yabai provides an incredibly powerful signal system that can execute commands in response to an event in Yabai (e.g. when a window is created, deleted, etc.). This plugin leverages this powerful system to emulate the dwm-style master-stack layout in Yabai.

Installation

This plugin uses Bun for faster startup times. To install it, you'll need to first install Bun, and then run the following command:

bun install --global yabai-master-stack-plugin

To update to a newer version, append @<version> at the end of the above install command (e.g. bun install --global yabai-master-stack-plugin@4.1.0)

Then, create a configuration file at ~/.config/ymsp/ymsp.config.json with the following contents (make sure to replace /usr/local/bin/yabai with the path of your yabai executable; if you're not sure what it is, run which yabai):

{
  "yabaiPath": "/usr/local/bin/yabai"
}

Then, add the following lines to your .yabairc:

yabai -m signal --add event=window_created action='ymsp window-created'
yabai -m signal --add event=application_launched action='ymsp window-created'
yabai -m signal --add event=window_moved action='ymsp window-moved'

ymsp on-yabai-start

Then, to make the actions of focusing on the next/prev window work smoothly, set the keybinds to execute the ymsp command and pass the appropriate task as the second argument. The list of possible tasks are:

close-focused-window: Quits the currently focused window by Yabai. \ decrease-master-window-count: Decreases the number of master windows. \ focus-down-window: Focuses on the window below the currently focused window. \ focus-up-window: Focuses on the window above the currently focused window. \ increase-master-window-count: Increases the number of master windows.

For example, if you're using skhd, add the following into your skhdrc file:

# focus windows
alt - j : ymsp focus-down-window
alt - k : ymsp focus-up-window

# adjust number of master windows
alt + shift - i : ymsp increase-master-window-count
alt + shift - d : ymsp decrease-master-window-count

Here is a real-world example usage of this plugin (using Karabiner + GokuRakuJoudo).

Troubleshooting

When binding shell commands to Karabiner, Node.js processes will abruptly exit without the exit handlers getting called to release a lockfile. This error can be fixed by adding a > /dev/null to the end of the node command in the karabiner shell_command property (see this commit).

If you have any other issues with this plugin, please don't hesitate to open an New Issue under the Issues tab!

TODO

  • Add an option to temporary disable auto-positioning of a window.
4.1.7

14 days ago

4.1.4

14 days ago

4.1.3

14 days ago

4.1.6

14 days ago

4.1.5

14 days ago

4.1.2

14 days ago

4.1.0

29 days ago

4.1.1

29 days ago

4.0.1

1 month ago

4.0.0

1 month ago

4.0.2

1 month ago

2.1.1-2

2 years ago

2.1.1-3

2 years ago

2.1.1-0

2 years ago

2.1.0-1

2 years ago

2.1.0-0

2 years ago

2.1.0-3

2 years ago

2.1.0-2

2 years ago

2.1.0

2 years ago

2.1.0-5

2 years ago

2.1.0-4

2 years ago

2.0.0

2 years ago

1.0.8

2 years ago

1.0.8-beta

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago