Saturday, February 25, 2017

Fix Dropbox Indicator Icon And Menu Not Working In Xubuntu Lubuntu Or Ubuntu MATE

Fix Dropbox Indicator Icon And Menu Not Working In Xubuntu Lubuntu Or Ubuntu MATE


I recently stumbled on an issue with Dropbox and the Ubuntu flavors that support AppIndicators (except Unity), like Xubuntu and Lubuntu: the Dropbox AppIndicator icon shows up as broken and the menu doesnt work. This isnt a new issue though, and it seems to occur starting with Ubuntu 14.04.

The issue occurs with the Dropbox packages in the official Ubuntu repositories (called "nautilus-dropbox", which doesnt depend on Nautilus and can be used to install Dropbox on any desktop environment) as well as the Dropbox package downloaded from its official website. 

It does not occur with the caja-dropbox package available in the official Ubuntu MATE 16.04 repository though (but it does occur in older Ubuntu MATE versions if youve enabled AppIndicators), because it was patched with a fix similar to the one in this article.

Below youll find a fix / workaround for this issue. Important: using the instructions below, Dropbox will use a tray (notification area) icon instead of an AppIndicator.

Heres a screenshot with the issue (taken in Xubuntu 16.04):


And another screenshot taken after using the fix below:


Tested in Xubuntu 16.04, Xubuntu 14.04, Lubuntu 16.04, Ubuntu MATE 16.04 (the issue does not occur with the caja-dropbox package in this Ubuntu MATE version) and Ubuntu MATE 14.04.

To fix it, you need to add "dbus-launch" before the actual command for the "Exec" line in both the application autostart file and launcher. For Dropbox this is a bit tricky because it overwrites any modifications to its autostart file. So heres what you need to do to fix this Dropbox issue:
  • if youve installed Dropbox by downloading the .deb from its website or by using the nautilus-dropbox package from the repositories:
    • rename the Dropbox autostart file, located in ~/.config/autostart/, and edit the file, changing the "Exec" line to "Exec=dbus-launch dropbox start -i";
    • copy the Dropbox desktop file, located under /usr/share/applications/, to ~/.local/share/applications/, so its not overwritten when updating the package, and change the "Exec" line to "Exec=dbus-launch dropbox start -i"
    • disable the built-in Dropbox autostart (because it automatically creates an autostart file) using the "dropbox autostart n" command.
  • for the caja-dropbox package (except for Ubuntu MATE 16.04 which doesnt have this issue):
    • rename the dropbox-caja autostart file, located in ~/.config/autostart/, and edit the file, changing the "Exec" line to "Exec=dbus-launch caja-dropbox start -i";
    • copy the caja-dropbox desktop file, located under /usr/share/applications/, to ~/.local/share/applications/, so its not overwritten when updating the package, and change the "Exec" line to "Exec=dbus-launch caja-dropbox start -i";
    • disable the built-in Dropbox autostart (because it automatically creates an autostart file) using the "caja-dropbox autostart n" command.

This sounds a bit complicated on a first look, right? Well, its not, but to make it easier, you can use the following commands to apply the changes I mentioned above.

If youve installed Dropbox by downloading the .deb from its website or by using the nautilus-dropbox package, you can fix the broken Dropbox appindicator icon and menu by using the following commands:
cp ~/.config/autostart/dropbox.desktop ~/.config/autostart/start_dropbox.desktop
sed -i s/^Exec=.*/Exec=dbus-launch dropbox start -i/ ~/.config/autostart/start_dropbox.desktop
dropbox autostart n
mkdir -p ~/.local/share/applications/
cp /usr/share/applications/dropbox.desktop ~/.local/share/applications/
sed -i s/^Exec=.*/Exec=dbus-launch dropbox start -i/ ~/.local/share/applications/dropbox.desktop

For Ubuntu MATE (except 16.04), if youve used the dropbox-caja package to install Dropbox, you can fix the broken Dropbox appindicator icon and menu by using the following commands:
cp ~/.config/autostart/caja-dropbox.desktop ~/.config/autostart/start_caja-dropbox.desktop
sed -i s/^Exec=.*/Exec=dbus-launch caja-dropbox start -i/ ~/.config/autostart/start_caja-dropbox.desktop
caja-dropbox autostart n
mkdir -p ~/.local/share/applications/
cp /usr/share/applications/caja-dropbox.desktop ~/.local/share/applications/
sed -i s/^Exec=.*/Exec=dbus-launch caja-dropbox start -i/ ~/.local/share/applications/caja-dropbox.desktop

Then restart the session (logout/login) and the Dropbox icon and menu should work correctly.

via / thanks to: TuxDiary and AskUbuntu


Available link for download

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.