Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Make "split_type" configuration applicable for a specific space. #2479

Open
pyinto opened this issue Nov 20, 2024 · 2 comments
Labels
addressed on master; not released Fixed upstream, but not yet released suggestion Request for new feature or some form of enhancement

Comments

@pyinto
Copy link

pyinto commented Nov 20, 2024

Background:

I have two displays:

  • display 1 - positioned horizontally [main one]
  • display 2 - positioned vertically [secondary]

Currently, I can only set only a global split-type setting, which is very inconvenient. My vertical display is usable only in horizontal split mode, but at the same time horizontal split mode is unusable for the horizontal display. Right now I have to tweak it with signals and scripting which is kinda junky and not that reliable.

Proposal:

It would be great to move this setting from "Global Settings" category down to "Space Settings" so that it's possible to have a different split_type for a specific space, like so:

yabai -m config --space 1 split_type vertical
yabai -m config --space 2 split_type horizontal
yabai -m config --space 3 split_type vertical
yabai -m config --space 4 split_type horizontal
yabai -m config --space 5 split_type auto

Current Config
https://github.com/koekeishiya/yabai/blob/master/doc/yabai.asciidoc#global-settings

My proposal is in line with the current syntax scheme:

Config
~~~~~~

General Syntax
^^^^^^^^^^^^^^

yabai -m config <global setting>::
    Get or set the value of <global setting>.

yabai -m config [--space '<SPACE_SEL>'] <space setting>::
    Get or set the value of <space setting>.


Global Settings
^^^^^^^^^^^^^^^

split_type [vertical|horizontal|auto]
    Specify how a window should be split.
    vertical: The window is split along the y-axis.
    horizontal: The window is split along the x-axis.
    auto: The axis is determined based on width/height ratio.

@Bellavene
Copy link

Bellavene commented Jan 1, 2025

yabai-per-display

#!/bin/zsh
display=$(yabai -m query --windows id,display --window | jq '.display')

case $display in
	1)
	yabai -m config split_type horizontal
	;;	
	2)
	yabai -m config split_type vertical
	;;
	*)
	echo "No active displays"
	;;
esac

.yabairc

yabai -m signal --add event=display_changed action='yabai-per-display'

@koekeishiya koekeishiya added addressed on master; not released Fixed upstream, but not yet released suggestion Request for new feature or some form of enhancement labels Jan 2, 2025
@koekeishiya
Copy link
Owner

Implemented proposal on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addressed on master; not released Fixed upstream, but not yet released suggestion Request for new feature or some form of enhancement
Projects
None yet
Development

No branches or pull requests

3 participants