GithubHelp home page GithubHelp logo

yabaictl's Introduction

yabaictl

A wrapper around yabai for better dual-monitor support.

This is a rewrite of the python version in rust. It is an excuse to learn rust.

The wrapper idea originally came from aiguofer/dotfiles.

This requires yabai 4.0.2+.

In 4.0.2, the yabai client/server message format has changed. yabaictl only supports the new format.

yabaictl's People

Contributors

slam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

yabaictl's Issues

Support Three Displays: Left - Center - Right

Is it possible to extend yabaictl to support also three displays aligned horizontally?
Screenshot 2022-07-20 at 16 15 29

        2 => {
            // This is the arrangement for two monitors with the one on the
            // right as primary:
            //
            // Right monitor:
            //
            // reserved s2 s4 s6 s8 s10 <= yabai space labels
            // Desktop1 D2 D3 D4 D5 D6  <= MacOS Desktop
            //
            // Left monitor:
            //
            // s1 s3 s5 s7  s9
            // D7 D8 D9 D10 D11
            //
            // With this arrangement, s1 and s2 form a single composite desktop,
            // so are s3 and s4, s5 and s6, and so on.
            //
            // The `focus_space` subcommand would switch two monitors in unison
            // as a single desktop.

Following the comment, the yabai space labels

  • s1, s2, s3
  • s4, s5, s6
  • s7, s8, s9
  • s10, s11, s12
  • s13, s14, s15

become composite desktops.

However, I am not sure how the yabai space labels should be assigned to the macOS spaces.

I have made the central monitor the primary and the macOS space labels are as following

Central monitor: D1-D6
Right monitor: D7-D11
Left monitor: D12-D16

One possibility would be:

            // Central monitor (primary):
            //
            // reserved s2 s5 s8 s11 s14 <= yabai space labels
            // Desktop1 D2 D3 D4  D5  D6  <= MacOS Desktop
            //
            // Left monitor:
            //
            // s1  s4  s7  s10 s13
            // D12 D13 D14 D15 D16
            //
            // Right monitor:
            //
            // s3 s6 s9 s12 s15
            // D7 D8 D9 D10 D11

Affected methods:

  • even_spaces
  • ensure_labels
  • focus_space
  • operate_window

macOS version 11.6.6 Big Sur

How to use it

Hey there, sorry for the basic question but I'm just getting started using yabai and multiple monitor setups. Would you mind telling me how you use these wrappers (e.g., what commands you use in your yabairc)? Thanks so much!

Clicking on app in dock on different space does not change space of 2nd monitor

I have tried to use yabaictl to sync spaces on two monitors following the scheme noted in the source code

            // This is the arrangement for two monitors with the one on the
            // right as primary:
            //
            // Right monitor:
            //
            // reserved s2 s4 s6 s8 s10 <= yabai space labels
            // Desktop1 D2 D3 D4 D5 D6  <= MacOS Desktop
            //
            // Left monitor:
            //
            // s1 s3 s5 s7  s9
            // D7 D8 D9 D10 D11

When I run $ yabaictl focus-space next/prev, yabaictl changes the focused space of both monitors which I want.

However, when I click on an app on the dock and the app is located on a non-visible space, the space of the second monitor does not change.

How could one use, e.g. yabai signal space-changed to fix this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.