4

After installing the Dropbox DEB package from their site and starting the Dropbox daemon, the tray icon for Dropbox doesn't show up in the tray. I have verified that Dropbox is, in fact, running, but the icon still doesn't show up.

How can I get the tray icon working in Elementary OS Luna/Freya?

8

As of 2015/04/27, the Dropbox daemon looks for a couple of environment variables on startup to try and correctly display the tray icon. Since these environment variables aren't set by Elementary OS, Dropbox just gives up and doesn't try to display a tray icon.

To test this theory, stop the Dropbox daemon like so:

dropbox stop

Next, start it with these two environment variables set:

DROPBOX_USE_LIBAPPINDICATOR=1 XDG_CURRENT_DESKTOP=Unity \
    dropbox start

Hooray, the tray icon is there!

enter image description here

To make this change permanent, you'll need to edit the autostart command for the Dropbox daemon. This desktop entry lives at $HOME/.config/autostart/dropbox.desktop. Since "Dropbox knows best™," the start command automatically regenerates this file, overwriting any changes you'd make there.

Therefore, copy it to $HOME/.config/autostart/dropbox-better.desktop. Next, create a script somewhere which will start Dropbox properly:

#!/bin/bash

# stop it if it's running
dropbox stop &>/dev/null

# start it properly
DROPBOX_USE_LIBAPPINDICATOR=1 XDG_CURRENT_DESKTOP=Unity \
    dropbox start -i 

Now open the dropbox-better.desktop file in your favorite text editor and modify it to this:

[Desktop Entry]
Name=Dropbox (Better)
GenericName=File Synchronizer
Comment=Sync your files across computers and to the web
Exec=/absolute/path/to/start-dropbox.sh
Terminal=false
Type=Application
Icon=dropbox
Categories=Network;FileTransfer;
StartupNotify=false

Log out and back in again to test that it's working, and you, like me, will finally have a Dropbox tray icon after something like 18 months without one!

  • I admire your patience! – user86969 Apr 27 '15 at 21:38
  • @Nasha Dropbox is a part of my lifecycle, you gotta do what you gotta do. It would still sync files in the background, so it was still functional IMO. 18 months, though, and something they could have fixed or at least provided docs for... – Naftuli Kay Apr 28 '15 at 2:41
  • Far from me to turn this into an off-topic ad for cloneware but if I had to suggest an (open source) alternative, I'd say seafile. It's the closest feature set to Dropbox I know of. – user86969 Apr 28 '15 at 11:42
  • The answer above works until you reboot - the Dropbox file then reverts Is there any way to fix the file so this doesn't happen? Would be fab! – user112889 May 3 '15 at 11:34
  • @grammo You should be able to copy the .desktop file to another name in the same folder, rename the Name= directive, and enable this startup application in "Startup Applications" and disable the old one. It's a hack, but it should work. Otherwise, you'll have to have those two env. variables exported for all X applications, which is overkill IMO. – Naftuli Kay May 4 '15 at 2:32
2

it worked for me following this script in Terminal:

https://github.com/zant95/elementary-dropbox

0

Not a direct solution to your issue, but you could consider just using a different service instead of the evil Dropbox. After all you are on Linux. http://www.drop-dropbox.com has some suggestions. I would add https://mega.co.nz/#sync which has a sync client for Linux and even Nautilus integration.

  • I hear you. I'll look into it. I'd like to self-host a service, but... effort... I'll get around to it someday, maybe. – Naftuli Kay Apr 28 '15 at 2:42
  • In a belated response to this, I'd like to recommend syncthing. It's open source and very security/privacy conscious and works over LAN and WAN. I'll likely be migrating to it soon. – Naftuli Kay Jul 23 '15 at 18:15
0

Just found out that the default dropbox script simply copies:

/usr/share/applications/dropbox.desktop

to

$HOME/.config/autostart/dropbox.desktop

So, instead of using the scripts suggested in the answer, simply edit:

/usr/share/applications/dropbox.desktop

Change the exec line to:

Exec=env XDG_CURRENT_DESKTOP=Unity QT_STYLE_OVERRIDE='' dropbox start -i

And then overwrite the autostart file:

cp /usr/share/applications/dropbox.desktop $HOME/.config/autostart/dropbox.desktop

Now, logout and login again and the problem is solved, forever. ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.