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

How to use opts? #88

Closed
enguerran opened this issue Oct 4, 2018 · 2 comments
Closed

How to use opts? #88

enguerran opened this issue Oct 4, 2018 · 2 comments

Comments

@enguerran
Copy link

sample code

In one of our projects, Cozy Drive for Desktop, we use the library to manage the creation and suppression of ~/.config/autostart/{appName}.desktop.

The executable is named through our build process that uses electron-builder, here is a .desktop sample that is created:

➜  cozy-desktop (master) ✗ cat ~/.local/share/applications/appimagekit-cozydrive.desktop
[Desktop Entry]
Name=Cozy Drive
Comment=Save them safely in your open source personal cloud, access them anywhere, anytime with the mobile application and share them with the world or just your friends and colleagues. You can host your own Cozy Cloud, and or use the hosting services. Your freedom to chose is why you can trust us.
Exec="/home/enguerran/Development/cozy/cozy-desktop/releases/CozyDrive-3.9.1-beta.2-x86_64.AppImage" %U
Terminal=false
Type=Application
Icon=appimagekit-cozydrive
X-AppImage-Version=3.9.1-beta.2.5865
X-AppImage-BuildId=34f00d20-bdce-11a8-0949-6f597858ee2b
StartupNotify=true
Categories=Network;FileTransfer;
X-Desktop-File-Install-Version=0.24
X-AppImage-Comment=Generated by /tmp/.mount_CozyDrPcYa5G/AppRun
TryExec=/home/enguerran/Development/cozy/cozy-desktop/releases/CozyDrive-3.9.1-beta.2-x86_64.AppImage

As you can see, the Exec value is leading to a binary AppImage named CozyDrive-3.9.1-beta.2-x86_64.AppImage.

Long story short: given the following opts value to auto-launch we were expecting to see ~/.config/autostart/Cozy-Desktop.desktop:

https://github.com/cozy-labs/cozy-desktop/blob/12e6d212c8b810542a33f36283b75a1af9819b08/gui/js/autolaunch.js#L3-L6

const opts = {
  name: 'Cozy-Desktop',
  isHidden: true
}

But as you can see in the screenshot, with opts set to

const opts = {
  name: 'cozydrive',
  path: '/usr/bin/ls'
}

We get ~/.config/autostart/ls.desktop. So opts.name seems override by fixOpts and execPath.

Is that a wanted behavior?

@adam-lynch
Copy link
Contributor

Please see that we're looking for contributors / maintainers: #64.

I'm happy to give access to people who are willing to help improve things, merge pull-requests, close issues, etc.

@enguerran
Copy link
Author

Sorry, not on the project anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants