We’ve all seen this probably, you install Linux Mint (or whatever Debian/Ubuntu based distro is your poison of choice lol) and you add the apt repo’s to install Dropbox/Nextcloud/OwnCloud, you install the app, it asks you nicely how you would like to log in, authenticates you, even starts synching as you can see the files pouring in, but wait!! where is the tray icon??
I like Dropbox/Nextcloud, as a matter of fact, my WordPress backups all live on Dropbox and get rotated and so forth (thanks to UpdraftPlus for that).
I use Nextcloud (which is a fork of Owncloud AFAIK) in my network to keep user profiles consistent across multiple OS and machines. If anyone is interested I’ll make a write-up on how to do this properly. 🙂
BUT the big caveat was that both didn’t show any icons in the tray bar of my favourite Linux Distro. I scoured forums etc and have come across the solution that simply introducing a delay into the startup of the app would solve it.
Some even suggested a script to start Dropbox, wait 10 seconds, stop it, wait 10 seconds and then start it again:
#!/bin/bash # DropStart.sh # Dropbox custom startup script to show the icon in the Panel dropbox start -i sleep 10; dropbox stop sleep 10; dropbox start -i
needless to say, this hasn’t worked lol, but then one entry on Github garnered my interest, it suggested to use dbus-launch, a Utility to start a message bus from a shell script, (more info on the man-page)
So off I went:
- Start “Startup Applications”
- Find your Dropbox, Nextcloud, OwnCloud entries
- Change each entry so that ‘dbus-launch’ is prepended (don’t forget the space after dbus-launch)
- (optional) Reset the delay of the startup item to 0 as it’s not really needed unless you have another reason to delay startup of the affected service
- Stop the affected service (eg: ‘dropbox stop’)
- Click on “Run now” once you have made the change
- Behold the awesomeness of the Tray Icon appearing for the service in question
What can I say, I don’t really know why it works this way, but I am guessing that “registering” the app to the D-Bus message bus is somehow required (see this excerpt from the man-page mentioned above :
in this case, dbus-launch will launch a session bus instance, set the appropriate environment variables so the specified program can find the bus, and then execute the specified program, with the specified arguments.
I hope this will help someone as much as did help me and please feel free to leave a comment below and/or share this article.