6

I use Xubuntu 16.10 and I want to run following command (this is the code for fixing dropbox icon) every time Linux session starts:

dropbox stop && env DBUS_SESSION_BUS_ADDRESS="" dropbox start -i

How can I do it?

I copied the code as a new command in session and start up -> Application autostart but it doesn't work.

3
  • Hi Woeitg, posted. Please mention if it works, will delete if not. Commented Jul 7, 2016 at 8:00
  • now it works. sorry I was very busy today. tnx
    – Sadegh
    Commented Jul 7, 2016 at 22:17
  • Possible duplicate of Xubuntu Dropbox Icon Fail
    – jarno
    Commented Oct 4, 2016 at 11:40

2 Answers 2

12

Timing issue

I am pretty sure it is because of the timing. The command most likely runs before its target is "in the field".

Changing the command into:

/bin/bash -c "sleep 15 && dropbox stop && env DBUS_SESSION_BUS_ADDRESS="" dropbox start -i" 

...will probably do the job.

4
  • Unfortunately it doesn't work. There is a question mark icon instead of dropbox icon without any pop up menu: i.imgur.com/UcU8y1y.png . If I run the command in terminal, then everything is fixed as expected
    – Sadegh
    Commented Jul 7, 2016 at 10:29
  • 1
    @Woeitg please try to increase the time to 45, if it works (I am pretty sure it should) , try to find the edge. Commented Jul 7, 2016 at 10:35
  • 1
    Jacob's code updated to new implementation: /bin/bash -c "sleep 15 && dropbox stop && dbus-launch dropbox start"
    – dez93_2000
    Commented Sep 7, 2017 at 20:18
  • I also having an issue in my xubuntu 16.04 lts ..so I run the above command /bin/bash -c "sleep 15 && dropbox stop && env DBUS_SESSION_BUS_ADDRESS="" dropbox start -i" and it finally works. thanks! Commented Sep 10, 2017 at 12:14
0

This problem bugged me for a -long- time, but finally a fix that works for me with Xubuntu 16.04:

The normal menu launcher (which works fine) uses ~/.local/share/applications/dropbox.desktop

which contains the line:

Exec=dbus-launch dropbox start -i

The startup launcher (which has the bug) uses ~/.config/autostart/dropbox.desktop

which contains the line:

Exec=dropbox start -i

The solution:

Use the same command for session startup as the normal menu launcher. Dead easy - but just one problem:

When the dropbox app runs, it overwrites ~/.config/autostart/dropbox.desktop with the command that fails, which it copies from /usr/share/applications/dropbox.desktop. So we need to fix this file rather than the one in ~/.config/autostart/dropbox.desktop

  1. In a terminal window, run the command:

    sudo mousepad /usr/share/applications/dropbox.desktop

    (if you don't use Mousepad, substitute the command for your preferred text editor)

  2. Enter your password when prompted

  3. Replace the line:

    Exec=dropbox start -i

    with:

    # Exec=dropbox start -i Exec=dbus-launch dropbox start -i

  4. Save the file and close Mousepad.

  5. Ensure that Dropbox Preferences are set to start Dropbox on system startup.

  6. Reboot to test.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .