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.