Signal, the private messaging app, ships an Electron-based desktop application available for Windows, Mac and Linux computers.
The Linux version by default does not support Wayland natively and will run through XWayland in a Wayland environment despite generally accepted system-wide configuration that should cause a different behavior.
That is not without a reason. Signal desktop for Linux ships its own packaged Electron build which does not respect $HOME/.config/electron-flags.conf
configuration nor has any custom -flags.conf
file to pull configuration from. I can speculate this behavior is due to (understandable) security concerns that would come from using external system-wide Electron and its configurations.
In this post I will summarize my journey into configuring Signal to work natively on Wayland and issues I encountered along the way.
Setting ELECTRON_OZONE_PLATFORM_HINT
environment variable to "auto"
will make Signal start without using XWayland.
This behavior didn't use to be the case in the past, and since Signal doesn't respect Electron flags set in a config file, the only option of making it run on Wayland was adding command-line flags directly into the .desktop
file. That obviously had its implications for example for window managers such as Sway, because they don't use those files to start applications.
Usually the easiest way to set up an environmental variable for your system is by creating a file in ~/.config/environment.d/
folder. I will assume you never set it up before, so here is what you need to do:
$ mkdir ~/.config/environment.d/
$ echo 'ELECTRON_OZONE_PLATFORM_HINT="auto"' >> ~/.config/environment.d/variables.conf
After variables from the configuration file are loaded, Signal (and other Electron applications) should start without using XWayland. You can verify that by running xlsclients
(signal-desktop
should not appear there).
However, this does not mean there are no issues…
There are some problems[1] with running Signal natively on Wayland. I will only cover some of them here, consult GitHub if you encounter different ones.
Trying to run Signal, you may notice it seems to not work initially, or only starts in system tray, not launching the window and you need to start the application twice or more to actually get it running. This might not be a desired behavior and does not normally happen under X11.
This problem can be approached in a few different ways.
The first solution is changing the maximized
key within ~/.config/Signal/ephemeral.json
file from false
to true
.
But this does not fully solve the issue, as contents of ~/.config/Signal/ephemeral.json
are overwritten by Signal on every startup. To solve this, you may need to create a script that will be run every time the app is closed or before it is started, setting the window maximization key to true
every time.
.desktop
fileAnother solution is less elegant and involves modifying the .desktop
file used to run the application in a desktop environment. That file controls entries in the application list!
First, you need to copy a system-wide .desktop
file and make a local copy of it. Then open it using a text editor:
$ cp /usr/share/applications/signal-desktop.desktop ~/.local/share/applications/
$ nano ~/.local/share/applications/signal-desktop.desktop
Once you have the file opened, find a line starting with Exec=
. It should be somewhere in the upper half of the file. Replace it with:
Exec=signal-desktop & sleep 1 && signal-desktop
After saving, you need to update the database of .desktop
files:
$ update-desktop-database ~/.local/share/applications/
That should result in the Signal application being called twice, once to start it minimized and once more to make it show up.
Third way of fixing this is, if available on your distribution, installing signal-desktop-fix-sway
build of Signal. It does fix this issue. Said package is available for example on Arch Linux through AUR.
Running Signal on Wayland not through XWayland may also cause a bunch of different visual glitches such as visual stuttering, glitchy shadows around the window or blurriness (e.g. with UI fractional scaling enabled). Unfortunately I do not know a way of fixing those. We probably need to wait for the developers to fix this :/
If you have any questions, feel free to reach out to me on the fediverse – you can find me there under @[email protected]
.
If you enjoyed this blog post you can share it or support me by buying me a coffee!