ihaveamac / ninfs

FUSE filesystem Python scripts for Nintendo console files
MIT License
438 stars 18 forks source link

Add A .desktop File for Linux #29

Closed CuriousTommy closed 5 years ago

CuriousTommy commented 6 years ago

It would be nice to have a way to launch the GUI application on Linux without needing to use terminal. Would you be able to provide a fuse3ds.desktop file? You can have it automatically install to ~/.local/share/applications.

Here is a guide to creating a .desktop file.

ihaveamac commented 6 years ago

Is it always ~/.local/share/applications, or is it based off an environment variable/some other config? I don't want to hardcode a path if there's a possibility of it changing.

CuriousTommy commented 6 years ago

I am actually not sure... I will ask about it on linuxquestion and let you know.

CuriousTommy commented 6 years ago

The XDG Base Directory states that .desktop files should be located in $XDG_DATA_HOME/applications/. If $XDG_DATA_HOME is not defined, then use $HOME/.local/share (so the path would be $HOME/.local/share/applications/)

You can read more about it here under "Environment variables" and here.

Credit goes to this Reddit post.

ihaveamac commented 5 years ago

I will probably include a .desktop file and have it installed with a command-line argument (e.g. python3 -mfuse3ds --install-desktop-entry). Doing this via setup.py would mean it's always installed, even if the user didn't install the gui. But I can't check if the user did install the gui via setup.py.

ihaveamac commented 5 years ago

Using python3 -mfuse3ds --install-desktop-entry [/path/to/share] writes fuse3ds.desktop and icons. It uses $XDG_DATA_HOME by default, unless you provide a prefix (e.g. /usr/share).

CuriousTommy commented 5 years ago

I just did a quick test, perfect! Just make sure you make a note about this on the readme.