swaywm / sway

i3-compatible Wayland compositor

Home Page:https://swaywm.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

create_output is undocumented

rpigott opened this issue · comments

Headlining the new features for 1.5 is the new create_output command, but it doesn't appear in sway(5).

Steps to reproduce:

$ swaymsg -t get_version
sway version v1.5-e215557b (Jul 16 2020, branch 'master')
$ MANPAGER=less LESS=+/create_output man 5 sway
Pattern not found

:(

Also could there maybe be a "docs" issue label? Wasn't sure where to file this.

Ooops. It was originally a developer-only feature, so intentionally undocumented. But now that it can be useful to end-users, it should definitely be documented.

Is there somewhere a developer-doc already existing? It could be used as template for the end-user doc and maybe useful for all finding this issue.

For references:

  • Introducing: #2669
  • Implementation of backend: #5216
  • Implementation of command: #5215

I wonder if it should remain undocumented and the command merged with output, like

output "HL_MY_NAME" create (any name prefixed with HL that does not exist)
output "HL_MY_NAME" destroy
(output "*" create to create a sequential HEADLESS# name)

Just posting it here for anyone else who has stumbled here & wants to get things working without looking at the commits to figure things out:
Someone at reddit posted their setup here along with an example config.

I asked ChatGPT

Somehow, ChatGPT knows the [EDIT: wrong] syntax.

DISCLAIMER:

I have n't checked if some of this works though (ChatGPT may have mis-learnt or may be writing a novel).

EDIT:

Many of the supplied arguments (mode, name, scale, ...) don't work.
I'll leave this comment here so that others don't have to re-invent the wheel (i.e. ask a GPT).

These are some extracts from its answer:

swaymsg create_output <output_name> [enable=<true/false>] [mode=<mode>] [position=<x> <y>] [scale=<scale>] [transform=<transform>] [background=<color/image>] [border=<normal/hide]] [layout=<layout>] [workspace=<workspace>]
- <output_name>: The name you want to assign to the new output.
- [enable=<true/false>]: Whether to enable the output immediately upon creation. Default is true.
- [mode=<mode>]: The display mode (resolution and refresh rate) of the output.
- [position=<x> <y>]: The position of the output relative to the top-left corner of the screen.
- [scale=<scale>]: The scaling factor for the output.
- [transform=<transform>]: The transformation to apply to the output (e.g., "90", "180", "270", "flipped", etc.).
- [background=<color/image>]: The background color or image for the output.
- [border=<normal/hide>]: Whether to show the window border on the output. Default is "normal".
- [layout=<layout>]: The initial layout for workspaces on the output.
- [workspace=<workspace>]: The initial workspace to assign to the output.

Copyrights?

I don't know about ChatGPT's copyright policies regarding its answers.
I have hope to have sited and 'disclaimed' it satisfactorily.