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.

dsg
  • 561
Sadegh
  • 1,125

2 Answers2

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.

Jacob Vlijm
  • 85,475
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.