samschott / maestral

Open-source Dropbox client for macOS and Linux
https://maestral.app
MIT License
3.12k stars 64 forks source link

Full path in desktop file #911

Open raffaem opened 1 year ago

raffaem commented 1 year ago

Installing maestral_qt with pip will create a desktop file under $HOME/.local/share/applications/maestral.desktop.

This desktop file will contain Exec=maestral_qt.

maestral_qt is installed under $HOME/.local/bin.

This is not in standard $PATH.

Adding $HOME/.local/bin to $PATH in .bashrc has no effect as desktop environments do not run .bashrc.

You will need another way to export that path in $PATH (see e.g. archlinux wiki).

The best way, I'm told. is to actually put the full path in the .desktop file.

I then request that the full path to the binary will put in the desktop file.

samschott commented 1 year ago

This is a tricky issue. Unfortunately, pip-installs are not really meant to install anything outside of Python's directories. The fact that it is possible to install something like a desktop file at all is something that is already deprecated, see https://setuptools.pypa.io/en/latest/userguide/datafiles.html. It is however not possible to dynamically change the content of such files using modern Python distribution methods. Since it is impossible to guess where exactly maestral_qt will be installed, I've opted to use the command name only, and left the burden of ensuring that its in the user's path on the user.

The real issue is packaging for Linux. The ideal solution would be to distribute Maestral as a "standalone" application. Unlike macOS, packing on Linux however is a can of worms. I've been reluctant to take this on.