Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Apr 2020 06:13:59 +0200
From:      Jan Beich <jbeich@FreeBSD.org>
To:        Grzegorz Junka <list1@gjunka.com>
Cc:        greg@unrelenting.technology, freebsd-x11@freebsd.org
Subject:   Re: Wayland on FreeBSD
Message-ID:  <bln9-pq48-wny@FreeBSD.org>
References:  <CAFYkXjmfyLZAi1HZe-RE3wLxa6GRNP6GkmtZG-4T2puRDOz0JA@mail.gmail.com> <9a914a03-d431-7d99-abb8-6f949e562f14@gjunka.com> <y2qg-z956-wny@FreeBSD.org> <0ec67eef-ac5d-2ec9-e1be-35304bb49af9@gjunka.com> <368n-f7yo-wny@FreeBSD.org> <d08d0409-89a3-efe0-b467-c93b166cedb7@gjunka.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Grzegorz Junka <list1@gjunka.com> writes:

> On 29/04/2020 01:31, Jan Beich wrote:
>
>> Grzegorz Junka <list1@gjunka.com> writes:
>>
>>> After the above env variables have been removed glxgears no longer starts:
>>>
>>> % glxgears
>>> Error: couldn't open display (null)
>> Make sure you haven't accidentally unset DISPLAY after it was set by
>> Sway and make sure DISPLAY was inherited by terminal emulator, shell and
>> whatever invokes those (e.g., tmux/screen, wofi/dmenu-wayland).
>
>
> OK, maybe it has something to do how I am starting sway and the
> applications. Please let me know what's the correct and accepted way
> and I will try with that.
>
> Currently I simply boot into the command line, login as root, load the
> graphics kernel modules,

Better set kld_list in /etc/rc.conf then disable root login except for
single user mode.

> then login as user, then "sway&" eventually "sway -d &> out.txt".

It can be started automatically e.g.,

    $ cat ~/.profile
    if [ -z "$DISPLAY" -a -z "$WAYLAND_DISPLAY" ]; then
        # Redirect noise from Sway, Xwayland, Firefox, etc.
        sway >~/.sway/log 2>&1 &
    fi

> Then I login over ssh from another computer and start a particular
> application.

Why not familarize yourself with Sway on a local machine before
attempting to forward applicatons over network? Another machine
introduces another source of potential misconfiguration.

Fiddling with DISPLAY/WAYLAND_DISPLAY variables is *not* required:
- To start Wayland apps remotely a la "ssh -X" use waypipe
- To start X11 apps remotely (on Wayland) use "ssh -X"
- To use Sway remotely start wayvnc then connect via a VNC client

> As I mentioned, gtk3-demo can be opened this way, the mouse and
> keyboard works fine and I can use the application. Firefox briefly
> opens a window then dumps core, any other application I tried either
> can't find DISPLAY (kwrite) and exits or seems to be working but
> doesn't display anything (xclock, uxrvt).

- To fix Firefox convert /tmp to tmpfs or unset MOZ_ENABLE_WAYLAND
- To fix kwrite/xclock/urxvt and Firefox/X11 debug Xwayland

> Please let me know what's the supported way of starting sway and I
> will check mpv and alacritty.

Locally: on console, on Xorg server, on another Wayland compositor.
For example, bug 244793 shows how to use VAAPI in Firefox without
leaving Xorg server using Sway or Cage as a compat shim.



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