You are not logged in.

#1 2019-12-25 20:41:53

myerscc
Member
From: Stockholm, Sweden
Registered: 2018-09-24
Posts: 13

[SOLVED] Getting programs to launch under Wayland, Sway, and xwayland

I've been setting up a new thinkpad t490 with arch and am giving wayland and sway a try over i3 this time.

I'm having difficulty getting some programs to start because they do or don't support wayland and I've not found a good configuration to make everything happy.

At the moment, firefox and code are what I'm having trouble with: firefox has wayland support and code (as an electron app) does not.

At first, I added `xwayland disable` to my sway config, and `env GDK_BACKEND=wayland firefox` worked to get firefox started. I added `GDK_BACKEND=wayland` to `/etc/environment` - but supposedly that's a bad idea and breaks things so I've since removed it.

Running `code --verbose` gives an error `Gtk-WARNING **: cannot open display:`. I tried things like running with `env DISPLAY=:0 code --verbose`, and `DISPLAY=:1` but neither worked. I re-enabled xwayland after finding out it was needed for electron apps, but still have the same problem. I wasn't sure if enabling xwayland in the sway config was sufficient so I also installed `xorg-server-xwayland` and rebooted.

Now `code --verbose` outputs nothing and doesn't exit immediately, but also no window appears. Additionally, firefox has stopped working; `env GDK_BACKEND=wayland firefox` doesn't work either - there's no error output, and no window appears, just like code.

kitty works fine, and I installed thunar which also works fine. Am I missing a dependency or some configuration? I would have thought that firefox would work with or without xwayland, and that code would either start working or have an error when starting with xwayland present. I've read that the compositor should use the appropriate display server automatically but it seems to not work.

Last edited by myerscc (2019-12-25 22:38:37)

Offline

#2 2019-12-25 22:37:27

myerscc
Member
From: Stockholm, Sweden
Registered: 2018-09-24
Posts: 13

Re: [SOLVED] Getting programs to launch under Wayland, Sway, and xwayland

This is now fixed, I'm not sure what has changed exactly but I'll leave the post up for posterity.

I spent some time configuring swaylock-effects while waiting on this post, restarted sway a few times and rebooted at least once. I just tried again and both firefox and code now launch without problems and without needing any special environment variables.

This is my env:

COLORTERM=truecolorDBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DISPLAY=:0
HOME=/home/carson
I3SOCK=/run/user/1000/sway-ipc.1000.32939.sock
INVOCATION_ID=ca67ae0f2f9c4890905bbb833a45359d
JOURNAL_STREAM=9:21708
KITTY_WINDOW_ID=1
LANG=en_CA.UTF-8
LOGNAME=carson
MAIL=/var/spool/mail/carson
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/carson/bin:/home/carson/go/bin:/home/carson/.cargo/bin:/home/carson/bin:/home/carson/go/bin:/home/carson/.cargo/bin
PWD=/home/carson
SHELL=/usr/bin/fish
SHLVL=2
SWAYSOCK=/run/user/1000/sway-ipc.1000.32939.sock
TERM=xterm-kitty
TERMINFO=/usr/lib/kitty/terminfo
USER=carson
WAYLAND_DISPLAY=wayland-0
XCURSOR_SIZE=24
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SESSION_CLASS=user
XDG_SESSION_ID=1
XDG_SESSION_TYPE=tty
XDG_VTNR=1

xwayland is not disabled in my sway config, as was mentioned in my OP.

Offline

Board footer

Powered by FluxBB