I'm trying to configure a Ansible script to install and configure Dropbox. One problem I'm running into is installing the daemon with "dropbox start --install". There doesn't seem to be any option to disable the graphical interface option if a display is available which prompts for a graphical confirmation before installing the daemon (and blocks my command-line process..). In the dropbox.py (https://www.dropbox.com/download?dl=packages/dropbox.py), this can be seen at the following line: line 290: GUI_AVAILABLE = os.environ.get("DISPLAY", '') and the if block that follows for the def download(). Would be nice to have this as an option for a pure command-line installation process.
I'm not so sure what you ask for really. 🧐 Yes, GUI is used if available. What is a kind of problem this? 🤔 Wrong would be opposite, I tink.
If only the GUI's usage of the control script in install time is a issue, then just do it by hand. Use something like the pointed here:
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
It's actually the same (as install actions), but guaranteed without GUI!
Would be a bit more complicated if the problem is usage of the actual application without GUI (while it is available). Just make a wrapper script (bash, for example), which ensure the DISPLAY environment variable gets wiped out before actual run of Dropbox application. Something like:
Name this script 'dropbox' and put it earlier in the PATH than the default 'dropbox' (i.e. before '/usr/bin'). In such a way, Dropbox application (the daemon) will not use GUI (also the initial install action, the one you are citing in your post). That's it. 😉
Hi @Здравко, thanks a lot for your response. Yes that's great. I went for the solution where the DISPLAY environment variable is set to null string when running the `dropbox start --install` command, which works as expected. The reason behind it is to install the daemon via Ansible (which is command-line only).
This is the code I'm using, in case anyone else finds it useful:
- name: Download and install Dropbox daemon.
command: dropbox start --install
"(?m)^In order to use Dropbox, you must download the proprietary daemon.*$": "y"
However, I'd argue that this requires knowledge of the dropbox.py script. Initially I expected to have an option, something like `dropbox start --install --no-gui` that would gurantee installation via command line. But the above also works fine.