Joplin not starting on Niri

Joplin was working fine on my GNOME desktop.

However, as I moved to Niri, it crashes on start. Running joplin-desktop in the terminal, shows this error:

Sentry: Initialized with autoUploadCrashDumps: false
[18692:0120/220624.507626:ERROR:ui/ozone/platform/x11/ozone_platform_x11.cc:250] Missing X server or $DISPLAY
[18692:0120/220624.507659:ERROR:ui/aura/env.cc:257] The platform failed to initialize.  Exiting.
zsh: segmentation fault (core dumped)  joplin-desktop

My understanding is that Joplin should work on Wayland, so, what’s going on here?

the error implies this application uses X. in wayland, that would be handled using Xwayland.
niri has some documentation on how they recommend handling that.
on NixOS, i handled that like this.
in the event you installed Niri using the external niri-flake, they offer an option to handle this.

I ran

export WAYLAND_DISPLAY=wayland-1
export ELECTRON_OZONE_PLATFORM_HINT=wayland
joplin-desktop

which made the app start.
So, I updated my config with:

environment.sessionVariables = {
          WAYLAND_DISPLAY = "wayland-1";
          ELECTRON_OZONE_PLATFORM_HINT = "auto";
        };

rebooted my laptop and now Joplin works fine :smiley:

1 Like

Thank you!
I feel like my solution is similar?
I will double-check your file in the morning to better understand what’s different. However, it works now, so, I might not change it anyway because if it’s not broken and all of that :laughing:

in fact, your solution is better here!

yours makes the application use wayland, which is what you want, if possible.
mine is a fallback for applications that do not support wayland natively, but need X.

1 Like