Hello,
trying to start keybase-gui on Swaywm. Here's what appears in my journal:
Sep 13 18:14:46 defiant systemd[939]: Starting Keybase GUI...
Sep 13 18:14:46 defiant systemd[939]: Started Keybase GUI.
Sep 13 18:14:48 defiant electron[16757]: cannot open display: :0
Sep 13 18:14:48 defiant systemd[939]: keybase.gui.service: Main process exited, code=exited, status=1/FAILURE
Sep 13 18:14:48 defiant systemd[939]: keybase.gui.service: Failed with result 'exit-cod
my log id: c6eec7e406877d920c9d941c
THX Frank
Hmm. What is your $DISPLAY?
DISPLAY=:0
I assume you're using the Arch community packages? @eli-schwartz any ideas?
Swaywm is a Wayland compositor, it does not use X11. I don't use Wayland myself, so I'm not familiar with the best way to make sure an application is successfully started under XWayland.
I think that Electron applications require XWayland due to continuing lack of support in libchromiumcontent (and more generally, in the Chromium browser) for native Wayland.
...
Do you have xwayland disable specified in your Swaywm configuration?
Yes I am using the package from the community repo.
x11wayland is not disabled in my config, xeyes for example is launching without any issues.
Can you open a command line and run this command not in systemd:
electron /usr/share/keybase-app
I found this https://github.com/swaywm/sway/issues/4050 and when I change GDK_BACKEND to x11 keybase-ui launches
with GDK_BACKEND=wayland I'm getting this error for your suggested command:
(electron:9920): Gtk-WARNING **: 10:40:34.478: cannot open display: :0
Do not set GDK_BACKEND=wayland globally. This is known to break apps.
Instead, don't set anything. GTK will automatically choose the most appropriate backend.
@zimbipw I don't know anything about wayland but you can set this environment variable only for keybase-gui.service using a systemd drop-in unit.
that's pretty cool, thanks for the hint. However, I guess rather sooner than later you will need to look into supporting Wayland sessions
I guess rather sooner than later you will need to look into supporting Wayland sessions
No, it's the other way around. Keybase doesn't need to do anything. However users need to make sure DISPLAY and WAYLAND_DISPLAY are correctly set when Keybase starts. This can be achieved by running systemctl --user import-environment on compositor startup.
@zimbipw
For X11, the default xinitrc.d already sets up the necessary environment variables in the systemd user session. There is a downstream bug report for Arch Linux to do the same in our swaywm packaging as well, which will probably solve your issue: https://bugs.archlinux.org/task/63021
I had this same issue and was able to fix it by creating a ~/.config/environment.d/.conf file:
$ cat ~/.config/environment.d/.conf
DISPLAY=:0
WAYLAND_DISPLAY=wayland-0
As detailed here.
I'm not sure if this command would have the same effect and could be placed in the sh script /usr/bin/keybase-gui?:
$ systemctl --user import-environment DISPLAY WAYLAND_DISPLAY
The $DISPLAY variable is controlled by the file .config/keybase/keybase.autogen.env. It's also taken care of by /etc/X11/xinit/xinitrc.d/50-systemd-user.sh before that.
If your wayland session uses sway, then it is handled by /etc/sway/conf.d/10-systemd.conf
Most helpful comment
I had this same issue and was able to fix it by creating a ~/.config/environment.d/.conf file:
As detailed here.
I'm not sure if this command would have the same effect and could be placed in the sh script
/usr/bin/keybase-gui?: