How minimize Signal messenger to system tray (top-right corner)?

11,845

Solution 1

Jiří Doubravský solution worked for Gnome on Ubuntu 19.04.

Add --use-tray-icon option inside the Exec line in /usr/share/applications/signal-desktop.desktop from:

Exec=/opt/Signal/signal-desktop --no-sandbox %U

To:

Exec=/opt/Signal/signal-desktop --use-tray-icon --no-sandbox %U

Restarted Signal a couple times and the tray icon shows up. Strange that this isn't enabled by default.

Solution 2

You can use optional arguments to start the application

--start-in-tray and/or --use-tray-icon

Startup launcher: Add both arguments.

Desktop launcher icon: Add just the second one argument. In menulibre, search for "Signal" and change command from "/opt/Signal/signal-desktop" %U to "/opt/Signal/signal-desktop" --use-tray-icon %U

source: https://github.com/signalapp/Signal-Desktop/issues/2911#issuecomment-439545459

Solution 3

I propose building onto robmsmt's one-liner to account for different launch options I've encountered in the wild (without --no-sandbox, with lowercase %u, and 'empty' option --), probably depending on Signal version and/or distro used.

sed -i '/^Exec/ {/--use-tray-icon/ !s/$/ --use-tray-icon/}' /usr/share/applications/signal-desktop.desktop (Needs sudo)

This will match a line starting with Exec and appending --use-tray-icon to the end of that line unless the line already contains --use-tray-icon.

I previously suggested using incron to automatically run such script when the desktop file is modified, but sadly upon closer inspection it didn't actually work as the files are not really modified but completely replaced during an upgrade. I didn't manage to get incron to work with that, but you might want to take a look if you're interested and more savvy. It should be safe though to run that script as a good 'ol cron job as root (sudo crontab -e) e.g. at reboot (adding @reboot script.sh to the table). It obviously doesn't take effect immediately after Signal upgrade, but will have to suffice until I figure out what's up with incron.

Solution 4

A one-liner. Personally I have this saved on my desktop since Signal updates seem to to remove it.

sudo sed -i 's/signal-desktop --no-sandbox %U/signal-desktop --use-tray-icon --no-sandbox %U/g' /usr/share/applications/signal-desktop.desktop

sed is find and replace matching signal-desktop --no-sandbox %U and replacing with signal-desktop --use-tray-icon --no-sandbox %U

Share:
11,845

Related videos on Youtube

Jiří Doubravský
Author by

Jiří Doubravský

Updated on September 18, 2022

Comments

  • Jiří Doubravský
    Jiří Doubravský over 1 year

    This is standard behaviour of all desktop messengers (Skype, Viber, Telegram, ..). All of them minimizes itself in system tray when Alt+F4 or close button is activated and they are running in background (instead of closing completely).

    How can I force Signal messenger to behave the same way?

  • Pa_
    Pa_ almost 5 years
    doesn't work...
  • Jiří Doubravský
    Jiří Doubravský almost 5 years
    ... it probably does not work if you install Signal using Snap... just use sudo apt install signal-desktop instead
  • Stefan Reich
    Stefan Reich about 4 years
    I'm using a different Linux (Peppermint 10), but I thought I'd tell people that this doesn't work for me. "Cannot read property 'isVisible' of undefined"
  • Abiral
    Abiral almost 4 years
    Thanks this works but signal tray icon disappears after the laptop is resumed from sleep. Is there a way to not make it disappear ?
  • BR123
    BR123 over 3 years
    Works for me on Ubuntu 20.04, as well. Thanks!
  • DADi590
    DADi590 about 3 years
    Isn't --no-sandbox a bad option to put there? (exploitation easier?)
  • Marcin Orlowski
    Marcin Orlowski almost 3 years
    This did not work for me, but --start-in-tray did.
  • Omer Sabic
    Omer Sabic over 2 years
    Works on Ubuntu 21.04 but for some reason you have to logout and log back in for it to work.