npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

yabai-master-stack-plugin

v4.1.7

Published

Emulate the dwm-style master-stack window layout in yabai!

Downloads

344

Readme

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 [email protected])

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.