Skip to content
New issue

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

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

Already on GitHub? # to your account

Feature Request - Add Labels for Displays #1616

Closed
varon opened this issue Feb 2, 2023 · 6 comments
Closed

Feature Request - Add Labels for Displays #1616

varon opened this issue Feb 2, 2023 · 6 comments
Labels
suggestion Request for new feature or some form of enhancement

Comments

@varon
Copy link

varon commented Feb 2, 2023

It would be very useful from a scripting perspective to be able to assign a label to a display and use that in DISPLAY_SEL.

For instance, 'left' or 'right' for displays is a lot easier to reason about than magical UUIDs, especially for commands involving sending spaces and windows to specific displays.

@brorbw
Copy link

brorbw commented Feb 10, 2023

I use

yabai -m display --focus west
yabai -m display --focus south
yabai -m display --focus north
yabai -m display --focus east

And equally for moving windows

yabai -m window --display west
yabai -m window --display south
yabai -m window --display north
yabai -m window --display east

If you already have it in a script you could assign it to something else

LEFT=<UUID-FOR-LEFT-SCREEN>
RIGHT=<UUID-FOR-RIGHT-SCREEN>

@varon
Copy link
Author

varon commented Feb 10, 2023

Thank you, @brorbw. That's a good set of suggestions.

Moving windows between displays is covered using the tools you've suggested, but sometimes I have need to move across multiple displays to get to the target.

I'm using screens by UUID currently for their various references, but this means I still have to store mappings between the UUID and 'human readable' display names - We're already attaching labels to spaces, so why not just add them as an optional field/reference in yabai?

@brorbw
Copy link

brorbw commented Feb 10, 2023

This should cover moving across multiple displays

alt - h: yabai -m window --focus west  || (yabai -m display --focus west  && yabai -m window --focus east)
alt - j: yabai -m window --focus south || (yabai -m display --focus south && yabai -m window --focus north)
alt - k: yabai -m window --focus north || (yabai -m display --focus north && yabai -m window --focus south)
alt - l: yabai -m window --focus east  || (yabai -m display --focus east  && yabai -m window --focus west)

Equally for moving windows:

shift + cmd - h: yabai -m window --swap west  || (yabai -m window --display west && yabai -m display --focus west)
shift + cmd - j: yabai -m window --swap south || (yabai -m window --display south && yabai -m display --focus south)
shift + cmd - k: yabai -m window --swap north || (yabai -m window --display north  && yabai -m display --focus north)
shift + cmd - l: yabai -m window --swap east  || (yabai -m window --display east && yabai -m display --focus east)

What label would you like to be assigned? You should be able to use the display index?

@koekeishiya
Copy link
Owner

On master it is possible to change how arrangement indices are interpreted (e.g. sort by x-coordinate/y-coordinate): #550 (comment)

This should allow for a more intuitive usage of default indices (1 to display_count).
I am not against adding labels if that is still regarded as a useful addition.

@koekeishiya koekeishiya added the suggestion Request for new feature or some form of enhancement label Mar 12, 2024
koekeishiya added a commit that referenced this issue Mar 12, 2024
@koekeishiya koekeishiya added the addressed on master; not released Fixed upstream, but not yet released label Mar 12, 2024
@koekeishiya
Copy link
Owner

Implemented labels for displays on master.

koekeishiya added a commit that referenced this issue Mar 12, 2024
@koekeishiya
Copy link
Owner

Fixed in v7.0.0.

@koekeishiya koekeishiya removed the addressed on master; not released Fixed upstream, but not yet released label Mar 13, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
suggestion Request for new feature or some form of enhancement
Projects
None yet
Development

No branches or pull requests

3 participants