On my Ubuntu 18.10 installation, I had a peculiar problem. While Discord did work, it didn’t appear in the tray. Not broken enough to warrant immediate action, but broken enough to annoy me.
A quick search on Internet narrowed the culprit to unset desktop environment variable. Simply setting
XDG_CURRENT_DESKTOP environment variable to
Unity fixed the issue altogether.
Armed with that knowledge, I first modified the application launcher for both desktop and startup:
$ sudo sed -i 's^Exec=/usr/share/discord/Discord^Exec=/usr/bin/env XDG_CURRENT_DESKTOP=Unity /usr/share/discord/Discord^' \ /usr/share/discord/discord.desktop \ ~/.config/autostart/discord-stable.desktop
To propagate the change, a quick update of desktop database was in order:
$ sudo update-desktop-database
Followed by termination of the existing Discord instances:
$ killall Discord ; killall Discord
Once I started Discord again, its icon appeared in its rightful place.