question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enable wayland through config or environment variable

See original GitHub issue

Your use case

Even if the wayland backend is considered experimental, the only way I know to actually enable Wayland support with Element is to pass the required command line arguments.

What would you like to do?

Setting Electron’s backend to Ozone with wayland support from a configuration file and/or from an environment variable.

Why would you like to do it?

In restricted environments like containers or flatpak, overriding command line arguments cannot be easily done: those extra arguments become necessary boilerplate. Config files and env vars can be passed down easily/selectively to containers.

In general Linux, permanent wayland support requires creating a custom .desktop file (in addition to the existing one) and aliases in the shell or defining a custom bash script passing down the flags. Config files and env vars would behave like a “set once and forget” configuration without having to go through the effort duplication we have to go through today.

How would you like to achieve it?

A config file (either reading the “standard” $XDG_CONFIG_HOME/electron-flags.conf or custom) and/or an environment variable (like ELEMENT_WAYLAND_EXPERIMENTAL=1) would improve wayland user experience at a tiny programming cost.

Have you considered any alternatives?

  • Creating a custom element bash script.
  • Adding aliases to my shell (or in general shell config if it should apply to all users).
  • Providing an additional custom .desktop file, making sure I pinned the “right” one.

All these are partial answers: they don’t cover all the usecases so they need to be all present.

Additional context

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
DashieTMcommented, Oct 21, 2022

@DashieTM https://github.com/vector-im/element-desktop/blob/develop/package.json#L72

We don’t create the desktop file even for the debian release, its created by electron-builder

That’s actually perfect! I just tested the --ozone-platform-hint=auto, it works as intended! It picked up that I have wayland and automatically switched to it.

With the electron builder we can ship this flag with the following setting: image

Here the full string on the .desktop file: image

0reactions
gdonvalcommented, Oct 21, 2022

I’m not the one who did the nvidia thing. That’s already there. 😃

Decoration, absolutely but also webrtc (if still needed)!

On Fri, 21 Oct 2022, 17:18 Christian Glombek, @.***> wrote:

If you also want a window around the application, you’ll need to add –enable-features=WaylandWindowDecorations:

Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=/app/bin/element --file-forwarding im.riot.Riot --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations @@u %U @@

This is absolutely something that eventually should land in the flatpak repo, but it might still be too early to try it again, as there still are bugs especially when moving the window between hidpi and lowdpi displays. Also @gdonval https://github.com/gdonval: Ut probably didn’t help that there was another unrelated nvidia change in the same PR.

I’ll wait a few weeks to see how --ozone-platform-hint=auto –enable-features=WaylandWindowDecorations stabilizes, and will then open a new PR.

— Reply to this email directly, view it on GitHub https://github.com/vector-im/element-web/issues/23436#issuecomment-1287176744, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUFREJYRHJCSC5ATLN6XPDWEK633ANCNFSM6AAAAAAQ66VED4 . You are receiving this because you were mentioned.Message ID: @.***>

Read more comments on GitHub >

github_iconTop Results From Across the Web

Environment variables for Wayland hackers - Ubuntu Discourse
If you want to make absolutely sure an app isn't running on Wayland, launch it with WAYLAND_DISPLAY set to something that definitly doesn't ......
Read more >
How to set environment variables for a Gnome Wayland session
A way that works for me is using ~/.pam_environment . Use man pam_env.conf ...
Read more >
Confused about environment variables under Wayland - Reddit
To set environment variables under Wayland, the Wiki says to use systemd environment. d . conf files.
Read more >
GNOME, Wayland, and environment variables - LWN.net
Many applications will change their behavior based on configuration stored in the environment; all of that configuration vanishes under Wayland.
Read more >
Set environment variables for gnome on wayland and bash on ...
Systemd version 233 (March 2017) added support for setting environment variables in ~/.config/environment.d/*.conf . See the environment.d ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found