Restore Dropbox icon on Lubuntu 16.10

After installing Dropbox on a fresh Lubuntu 16.10, I was missing the Dropbox icon in my task bar.

From several posts, I learnt that installing the package libappindicator1 as follows should help:

sudo apt-get install libappindicator1

Alas,  the icon was still missing.

Finally, I found the a post that suggested to set the environment variable XDG_CURRENT_DESKTOP to Unity:

dropbox stop && env XDG_CURRENT_DESKTOP=Unity dropbox start

After verifying that this worked, I modified the corresponding desktop entry that corresponds to Dropbox (For a full list, see Start menu -> Preferences -> Default applications for LXSession). The entry is located in ~/.config/autostart on my system. I copied the file Dropbox.desktop to Dropbox-custom.desktop and set the Exec line to the following content.

Name=Dropbox-custom # If you like - helps to distinguish this file from the one generated by Dropbox
# ...
# Was before: Exec=dropbox start -i
Exec=env XDG_CURRENT_DESKTOP=Unity dropbox start -i

Afterwards, I disabled the option Start Dropbox on system startup in the Dropbox preferences – otherwise, Dropbox would override the .desktop entry.

Credit: Thanks for idobrinescu, who proposed this fix for Elementary OS Freya.