Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jul 2018 17:40:54 +0300
From:      Greg V <greg@unrelenting.technology>
To:        Denis Polygalov <dpolyg@gmail.com>
Cc:        FreeBSD X11 mailing list <freebsd-x11@freebsd.org>
Subject:   Re: How to run (if possible at all) Wayland compositor on FreeBSD without Xorg
Message-ID:  <1532356854.75524.0@hraggstad.unrelenting.technology>
In-Reply-To: <4f8d6f08-8f29-fb8f-0cc2-42406929301f@gmail.com>
References:  <4f8d6f08-8f29-fb8f-0cc2-42406929301f@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help


On Mon, Jul 23, 2018 at 4:39 PM, Denis Polygalov <dpolyg@gmail.com> 
wrote:
> Hi all,
> 
> I have:
> 11.2-RELEASE +
> drm-stable-kmod +
> graphics/mesa-libs compiled from ports with Wayland support enabled +
> graphics/wayland installed from packages +
> graphics/qt5-wayland compiled from ports
> Weston compiled from source manually.
> 
> I am able to run Weston or minimal Wayland compositor from
> qt5-wayland examples, but only if I do this from inside
> of Xorg session (xterm).
> Attempt to run from console lead to: "Could not connect to any X 
> display" error message.
> As far as I understand this calling syntax:
> $ ./some_exe -platform wayland
> is intended to be used only for Wayland *clients* not compositors.
> 
> Is it possible to run any Wayland *compositor* without Xorg running?
> How this configured? Which software is responsible for this?
> Sorry if this is wrong place to ask...

Hi,

the Big Deal here is that starting a wayland compositor requires 
something to provide access to GPU and input devices.

The big compositors (GNOME Shell, KDE KWin) rely on logind, which we 
don't have.

For Weston, there is a setuid binary called 'weston-launch' that works.

Sway and other wlroots based compositors also have something similar, I 
forget already.

So:

- Install libinput from my ports 
(https://github.com/myfreeweb/freebsd-ports-dank/tree/master/x11/libinput)
- Install Weston from my fork (https://github.com/myfreeweb/weston)
- Add yourself to the 'weston-launch' group
- Make sure the 'weston-launch' binary is suid and owned by root
- Make sure you have an 'XDG_RUNTIME_DIR' in the environment
- Put your favorite keyboard settings into the environment e.g. 'export 
XKB_DEFAULT_LAYOUT=us XKB_DEFAULT_VARIANT=colemak 
XKB_DEFAULT_MODEL=pc101 XKB_DEFAULT_RULES=evdev 
XKB_DEFAULT_OPTIONS="ctrl:nocaps,ctrl:lctrl_meta,compose:ralt,grp:alt_space_toggle"'
- Run 'weston-launch'!

The libinput in my ports has this patch 
https://github.com/myfreeweb/freebsd-ports-dank/blob/master/x11/libinput/files/patch-src_evdev.c.reopen 
which should fix /dev permissions issues. If that doesn't work, or you 
decide not to use it, give yourself read+write permissions on 
/dev/tty*, /dev/input/*, /dev/dri/*, /dev/drm/*.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1532356854.75524.0>