Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid .desktop file is created if path contains spaces on Linux #99

Closed
alexhenrie opened this issue Oct 17, 2019 · 6 comments
Closed
Assignees
Labels

Comments

@alexhenrie
Copy link

If the path contains spaces, e.g. /opt/IPFS Desktop/ipfs-desktop, it needs to be quoted in the Exec line of the .desktop file. Otherwise the part before the space is interpreted to be the filename and the part after the space is interpreted to be a commandline argument.

@miyanoshiyo
Copy link

Can you use auto-launch on Linux successfully? I cannot work it on linux

@phellipeandrade
Copy link

Still relevant!

@erik-404err
Copy link

Im having the same problem. Manually launching the .desktop file i get the error: There was an error launching the application.
If anyone runs into this as well, you can go to /home/{yourName}/.config/autostart/ and open the .desktop file. it should look like this:

#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Version=1.0
Name=appName
Comment=appNamestartup script
Exec=/opt/Some Name/appName
StartupNotify=false
Terminal=false

you need to change this to:

Exec= "/opt/Some Name/appName"

this is especially sad for NW.js / electron since:
"options.path - String (optional for NW.js and Electron apps)"
~ https://github.com/Teamwork/node-auto-launch/blob/master/README.md

Hope that this helped someone and that this gets fixed soon (because you cant tell everyone installing you app to modify files)

@joel1st
Copy link

joel1st commented Jan 10, 2021

For those looking for a work around that allows you to still use the library:
You explicitly pass in a path if it is an AppImage, and add a back slash before any space characters (which escapes it).

  let name = 'Application Name';

  let autoLauncher = new AutoLaunch(
    process.env.APPIMAGE
      ? {
          name: name,
          path: `${process.env.APPIMAGE}`.replace(/ /g, '\\ '),
        }
      : {
          name: name,
        }
  );

@Izurii
Copy link

Izurii commented May 20, 2021

As the originals developers of the package is not maintaining this project anymore, I replicated and will be taking over, if you could take a look at it I'll be happy. This issue is already solved in my version of the project.

https://github.com/Izurii/easy-auto-launch

@Oxalin Oxalin self-assigned this Dec 4, 2023
@Oxalin Oxalin added the bug label Dec 4, 2023
@Oxalin
Copy link
Contributor

Oxalin commented Dec 7, 2023

Related to #78

@Oxalin Oxalin closed this as completed in 39d80e0 Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants