swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.71k stars 1.11k forks source link

Be able to specify Wayland socket name #7586

Open mkoskar opened 1 year ago

mkoskar commented 1 year ago

To aid predictability of WAYLAND_DISPLAY, for when it needs to be specified outside of existing Wayland session, especially when multiple sessions might exist.

Taking inspiration from weston:

-Sname, --socket=name
       Weston  will  listen  in the Wayland socket called name.  Weston
       will export WAYLAND_DISPLAY with this value in  the  environment
       for  all  child  processes to allow them to connect to the right
       server automatically.

So specifying e.g., --socket=wayland-vt1 would yield WAYLAND_DISPLAY=wayland-vt1.

csergi commented 1 month ago

Would be very useful for some applications with sway's headless mode.

emersion commented 1 month ago

Related: https://github.com/swaywm/sway/pull/8259