Dropbox issue on ubuntu mate 15.10 and 16.04 beta

Thanks Lobsta, that worked for me as well. I updated my Startup Script to include 'dbus-launch" and now it works after logging on. Works in that (a) the icon is back; and (b) the context menu now appears when you left click the icon.

Brilliant, fixed the PANEL icon issue perfectly. Now if only I could get indicators on the files themselves to show what was syncā€™d and what wasnā€™t that would be perfect.

Wimpyā€™s post above is what I had to do to get the indicators on the files and folders:

Just installed UM 16.04, and experienced the same issue. Installed Caja-Dropbox from the Welcome/Software. 64bit, Thinkpad X201.

I tried ā€œ~$ dropbox stop && dbus-launch dropbox startā€ from a post above, and modified with
ā€œ~$ caja-dropbox stop && dbus-launch caja-dropbox startā€

It works, but now what?

This issue is not just affecting Ubuntu MATE, it is a widespread issue with some statically compile Qt5 applications such as Dropbox and Telegram Desktop. It is apparently fixed fix in Qt 5.5. Iā€™ve been working on a script to automatically ā€œrepairā€ .desktop files of the affected applications.

Iā€™m not sure I want to integrated this into Ubuntu MATE to run automatically because we donā€™t know what the future holds for the applications behaviour and what my fix might do to them in the future.

For now, here is the script. Copy and paste it, save it then make it executable (chmod +x <file> from a Terminal) and run it. Log out then back in. Let me know if Dropbox and Telegram are working correctly.

This ā€œfixā€ is specific to MATE, and Ubuntu MATE by extension, so please donā€™t share it with people running other desktop environments as it may do "bad things"ā„¢.

#!/usr/bin/env bash

FIXES=0

# If .desktop file is not dbus-launch prefixed, correct it.
function prefix_dbus(){
    local DESKTOP="${1}"
    local NAME="${2}"
    CHECK=$(grep "Exec=dbus-launch" "${DESKTOP}" 2>/dev/null)
    if [ $? -eq 0 ]; then
        continue
    else
        echo " - Found ${NAME} in ${DESKTOP}, correcting now..."
        sed -i "s/Exec=/Exec=dbus-launch /" "${DESKTOP}"
        ((FIXES += 1))
    fi
}

for APP in "caja dropbox" dropbox telegram; do
    # Find system desktop files, copy locally if they don't already exist.
    for DIR in /usr/share/applications; do
        echo "Checking ${DIR} for ${APP}"
        for FILE in ${DIR}/*.desktop; do
            GREP=$(grep -i "Name=${APP}" "${FILE}" 2>/dev/null)
            if [ $? -eq 0 ]; then
                if [ ! -f "${HOME}/.local/share/applications/$(basename ${FILE})" ]; then
                    echo " - Found ${APP} in ${FILE}, copying locally..."
                    cp "${FILE}" "${HOME}/.local/share/applications/$(basename ${FILE})"
                fi
            fi
        done
    done

    # Find local desktop files and correct them.
    for DIR in "${HOME}/.config/autostart" "${HOME}/.config/mate-session/saved-session" "${HOME}/.local/share/applications"; do
        echo "Checking ${DIR} for ${APP}"
        for FILE in ${DIR}/*.desktop; do
            if [ -f "${FILE}" ]; then
                GREP=$(grep -i "Name=${APP}" "${FILE}" | grep -v chrome 2>/dev/null)
                if [ $? -eq 0 ]; then
                    # Skip any Google Chome and Chromium
                    CHROME=$(grep -i "chrom" "${FILE}" 2>/dev/null)
                    if [ $? -eq 0 ]; then
                        continue
                    fi
                    prefix_dbus "${FILE}" "${APP}"
                fi
            fi
        done
    done
done

if [ ${FIXES} -ne 0 ]; then
    update-desktop-database "${HOME}/.local/share/applications"
    echo "Please log out and back in for these changes to take effect."
else
    echo "No changes were required. Carry on."
fi
5 Likes

ā€¦in the script there seems to be a typing error.
So far I could not test it. But i will let you know if it works.

So now i was able testing it. Itā€™s working!
Thank you, Wimpy!

1 Like

I downloaded and installed caja-dropbox from mint packages; http://packages.linuxmint.com/list.php?release=Rafaela

Then installed the deb file from the dropbox website.

Thenā€¦ It works.

Iā€™ve done some testing and installing libdbusmenu-jsonloader4 on my Ubuntu MATE 16.04 and then restarting has restored the Dropbox icon on my computer.

Can some else please verify?

Sorry Wimpy, doesnā€™t work for me. Dropbox works when running the dbus command as per above. I havenā€™t figured out how to fix my Telegram indicator though.

The script you provided is not running properly; it gives an error message: Syntax error : ā€œ(ā€ unexpected
Might be a mistake on my part though.

Iā€™ve tried this on Ubuntu 15.10 (+ Mate PPA) and it doesnā€™t fix the issue. I havenā€™t tried your script, though, not sure itā€™s supposed to be needed or if installing this lib is an alternative to the script?

EDIT: the script works, though it puts back the Dropbox icon in the system tray. Do you think there would be a way to make it work as an indicator on Mate?

EDIT: for some reason, the .desktop file in ~/.config/autostart (fixed by the script) keeps getting back to the original launcher. Iā€™m not sure when/how it happens, I guess Dropbox checks it at some point and copy it back from /usr/share/applications.

I had similar problems on Cinnamon, and yes, whenever Dropbox starts it seems to go back to the original .desktop file. I fixed it there by turning off autostart within Dropbox menu, and adding my own entry with the correct version of the command to the Startup programs entry - I havenā€™t had a chance to try it here to see if the same thing will fix the problem.

ETA - yes, I created my own start-up entry with the command

dbus-launch caja-dropbox start

and that has given me a working visible Dropbox icon.

1 Like

Iā€™ve patched caja-dropbox, for those of you running 16.04 please test the appropriate deb for your system:

**Make sure you delete any modified caja-dropbox.desktop files in ~/.local/share/applications and ~/.config/autostart`.

1 Like

Iā€™m now maintaining a PPA for telegram that works around this missing icon issue.

1 Like

Installing the patched version of caja-dropbox worked for me! Thanks Wimpy!

As a way of ā€œpaying it forwardā€, here is what I did to delete the files:
$ caja-dropbox stop
$ cd ~/.config/autostart
$ sudo rm caja-dropbox.desktop

I couldnā€™t get Dropbox to autostart, so I pasted this into the terminal:
$ caja-dropbox autostart y

Reboot or run this to start Dropbox
$ dbus-launch caja-dropbox start

1 Like

This solved my problem! Thanks again, Wimpy!

That said; I had to do some fiddling around to get i to work. I probably should have uninstalled the original version first? I see that the Software Boutique is updated with the correct PPA; is this because I added the PPA or is it sufficient to update the system, and the PPA will be added automagically?

Btw, is it possible to build a PPC version?

1 Like

No PPC version yet, that is much more complex. But something Iā€™ll look into.

1 Like

Thanks for posting the script to fix the problem of the missing dropbox notification icon and its associated menu. It fixed my problem with a fresh install of Ubuntu MATE 16.04.4