<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
      <title>rail - guide</title>
      <link>https://flufftech.net</link>
      <description>enby fox on the internet :3</description>
      <generator>Zola</generator>
      <language>en</language>
      <atom:link href="https://flufftech.net/tag/guide/rss.xml" rel="self" type="application/rss+xml"/>
      <lastBuildDate>Sun, 04 May 2025 00:00:00 +0000</lastBuildDate>
      <item>
          <title>Running Signal desktop app natively on Wayland</title>
          <pubDate>Sun, 04 May 2025 00:00:00 +0000</pubDate>
          <author>rail</author>
          <link>https://flufftech.net/posts/signal-desktop-natively-on-wayland/</link>
          <guid>https://flufftech.net/posts/signal-desktop-natively-on-wayland/</guid>
          <description xml:base="https://flufftech.net/posts/signal-desktop-natively-on-wayland/">&lt;p&gt;Signal, the private messaging app, ships an Electron-based desktop application available for Windows, Mac and Linux computers.&lt;&#x2F;p&gt;
&lt;p&gt;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.&lt;&#x2F;p&gt;
&lt;p&gt;That is not without a reason. Signal desktop for Linux ships its own packaged Electron build which does not respect &lt;code&gt;$HOME&#x2F;.config&#x2F;electron-flags.conf&lt;&#x2F;code&gt; configuration nor has any custom &lt;code&gt;-flags.conf&lt;&#x2F;code&gt; 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.&lt;&#x2F;p&gt;
&lt;p&gt;In this post I will summarize my journey into configuring Signal to work natively on Wayland and issues I encountered along the way.&lt;&#x2F;p&gt;
&lt;!-- toc --&gt;
&lt;h2 id=&quot;making-signal-not-use-xwayland&quot;&gt;Making Signal not use XWayland&lt;&#x2F;h2&gt;
&lt;div class=&quot;side-note&quot;&gt;
    &lt;strong&gt;Note:&lt;&#x2F;strong&gt;&amp;nbsp;At the beginning of writing this blog, I was not aware of Signal actually respecting an environment variable and wanted to suggest a different, more complicated solution. The things you get to know ^^
&lt;&#x2F;div&gt;
&lt;p&gt;Setting &lt;code&gt;ELECTRON_OZONE_PLATFORM_HINT&lt;&#x2F;code&gt; environment variable to &lt;code&gt;&quot;auto&quot;&lt;&#x2F;code&gt; will make Signal start without using XWayland.&lt;&#x2F;p&gt;
&lt;p&gt;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 &lt;code&gt;.desktop&lt;&#x2F;code&gt; file. That obviously had its implications for example for window managers such as Sway, because they don’t use those files to start applications.&lt;&#x2F;p&gt;
&lt;p&gt;Usually the easiest way to set up an environmental variable for your system is by creating a file in &lt;code&gt;~&#x2F;.config&#x2F;environment.d&#x2F;&lt;&#x2F;code&gt; folder. I will assume you never set it up before, so here is what you need to do:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #A9B1D6; background-color: #1A1B26;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C0CAF5;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECE6A;&quot;&gt; mkdir ~&#x2F;.config&#x2F;environment.d&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C0CAF5;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECE6A;&quot;&gt; echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt; &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECE6A;&quot;&gt;ELECTRON_OZONE_PLATFORM_HINT=&amp;quot;auto&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;&amp;#39; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECE6A;&quot;&gt; ~&#x2F;.config&#x2F;environment.d&#x2F;variables.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;div class=&quot;side-note&quot;&gt;
    &lt;strong&gt;Note:&lt;&#x2F;strong&gt;&amp;nbsp;This solution only works for distributions using systemd. If you don’t use one of those, I’m sure you know best how to set up env variables on your system!
&lt;&#x2F;div&gt;
&lt;p&gt;After variables from the configuration file are loaded, Signal (and other Electron applications) should start without using XWayland. You can verify that by running &lt;code&gt;xlsclients&lt;&#x2F;code&gt; (&lt;code&gt;signal-desktop&lt;&#x2F;code&gt; should &lt;strong&gt;not&lt;&#x2F;strong&gt; appear there).&lt;&#x2F;p&gt;
&lt;p&gt;However, this does not mean there are no issues…&lt;&#x2F;p&gt;
&lt;h2 id=&quot;problems-ahead&quot;&gt;Problems ahead&lt;&#x2F;h2&gt;
&lt;p&gt;There are &lt;em&gt;some&lt;&#x2F;em&gt; problems&lt;a class=&quot;external&quot; rel=&quot;noopener nofollow external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;signalapp&#x2F;Signal-Desktop&#x2F;issues?q=state%3Aopen%20label%3A%22Wayland%22&quot;&gt;&lt;sup&gt;[1]&lt;&#x2F;sup&gt;&lt;&#x2F;a&gt; with running Signal natively on Wayland. I will only cover some of them here, consult GitHub if you encounter different ones.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;problem-1-starting-minimized&quot;&gt;Problem 1: Starting minimized&lt;&#x2F;h3&gt;
&lt;div class=&quot;side-note&quot;&gt;
    &lt;strong&gt;Note:&lt;&#x2F;strong&gt;&amp;nbsp;Check if GitHub issue &lt;a class=&quot;external&quot; rel=&quot;noopener nofollow external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;signalapp&#x2F;Signal-Desktop&#x2F;issues&#x2F;6368&quot;&gt;#6368&lt;&#x2F;a&gt; hasn’t been fixed at the time of reading. Maybe you don’t need to do anything!
&lt;&#x2F;div&gt;
&lt;p&gt;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.&lt;&#x2F;p&gt;
&lt;p&gt;This problem can be approached in a few different ways.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;solution-1-json-config&quot;&gt;Solution 1: JSON config&lt;&#x2F;h4&gt;
&lt;p&gt;&lt;strong&gt;The first solution&lt;&#x2F;strong&gt; is changing the &lt;code&gt;maximized&lt;&#x2F;code&gt; key within &lt;code&gt;~&#x2F;.config&#x2F;Signal&#x2F;ephemeral.json&lt;&#x2F;code&gt; file from &lt;code&gt;false&lt;&#x2F;code&gt; to &lt;code&gt;true&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;But this does not fully solve the issue, as contents of &lt;code&gt;~&#x2F;.config&#x2F;Signal&#x2F;ephemeral.json&lt;&#x2F;code&gt; 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 &lt;code&gt;true&lt;&#x2F;code&gt; every time.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;solution-2-desktop-file&quot;&gt;Solution 2: &lt;code&gt;.desktop&lt;&#x2F;code&gt; file&lt;&#x2F;h4&gt;
&lt;div class=&quot;side-note&quot;&gt;
    &lt;strong&gt;Note:&lt;&#x2F;strong&gt;&amp;nbsp;If you use a window manager, ignore this section entirely and skip to the &lt;a href=&quot;#solution-3-patched-build&quot;&gt;section below&lt;&#x2F;a&gt; instead.
&lt;&#x2F;div&gt;
&lt;p&gt;Another solution is less elegant and involves modifying the &lt;code&gt;.desktop&lt;&#x2F;code&gt; file used to run the application in a desktop environment. That file controls entries in the application list!&lt;&#x2F;p&gt;
&lt;p&gt;First, you need to copy a system-wide &lt;code&gt;.desktop&lt;&#x2F;code&gt; file and make a local copy of it. Then open it using a text editor:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #A9B1D6; background-color: #1A1B26;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C0CAF5;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECE6A;&quot;&gt; cp &#x2F;usr&#x2F;share&#x2F;applications&#x2F;signal-desktop.desktop ~&#x2F;.local&#x2F;share&#x2F;applications&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C0CAF5;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECE6A;&quot;&gt; nano ~&#x2F;.local&#x2F;share&#x2F;applications&#x2F;signal-desktop.desktop&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Once you have the file opened, find a line starting with &lt;code&gt;Exec=&lt;&#x2F;code&gt;. It should be somewhere in the upper half of the file. &lt;strong&gt;Replace it&lt;&#x2F;strong&gt; with:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #A9B1D6; background-color: #1A1B26;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C0CAF5;&quot;&gt;Exec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECE6A;&quot;&gt;signal-desktop&lt;&#x2F;span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C0CAF5;&quot;&gt; sleep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF9E64;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C0CAF5;&quot;&gt; signal-desktop&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After saving, you need to update the database of &lt;code&gt;.desktop&lt;&#x2F;code&gt; files:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #A9B1D6; background-color: #1A1B26;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C0CAF5;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECE6A;&quot;&gt; update-desktop-database ~&#x2F;.local&#x2F;share&#x2F;applications&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That should result in the Signal application being called twice, once to start it minimized and once more to make it show up.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;solution-3-patched-build&quot;&gt;Solution 3: Patched build&lt;&#x2F;h4&gt;
&lt;p&gt;&lt;strong&gt;Third way&lt;&#x2F;strong&gt; of fixing this is, if available on your distribution, installing &lt;a class=&quot;external&quot; rel=&quot;noopener nofollow external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;aur.archlinux.org&#x2F;packages&#x2F;signal-desktop-fix-sway&quot;&gt;&lt;code&gt;signal-desktop-fix-sway&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; build of Signal. It does fix this issue. Said package is available for example on Arch Linux through AUR.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;problem-2-visual-glitches&quot;&gt;Problem 2: Visual glitches&lt;&#x2F;h3&gt;
&lt;p&gt;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 :&#x2F;&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;If you have any questions, feel free to reach out to me on the fediverse – you can find me there under &lt;a class=&quot;external&quot; rel=&quot;noopener nofollow external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;social.flufftech.net&#x2F;@rail&quot;&gt;&lt;code&gt;@rail@flufftech.net&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
</description>
      </item>
    </channel>
</rss>
