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

Spoon lifecycle behaviour tweaks #1480

Open
z3t0 opened this issue Jul 3, 2017 · 5 comments
Open

Spoon lifecycle behaviour tweaks #1480

z3t0 opened this issue Jul 3, 2017 · 5 comments

Comments

@z3t0
Copy link

z3t0 commented Jul 3, 2017

There are a few things with the way spoons are installed that make it somewhat dangerous. Here are my recommendations

  1. There should be a dialog that asks if a spoon should be installed, that way you cannot accidentally install one.
  2. A copy of the spoon should be placed in the hammerspoon directory. The original should be left alone OR the user should be prompted if they want to remove it (similar to how installers ask to delete themselves)
  3. The spoon inside .hammerspoon/Spoons should not be a .spoon folder as it is too easy to accidentally open that file and it gets launched by hammerspoon. This has happened to me a few times and the spoon folder just gets mysteriously deleted from my system...

What do you think?

@asmagill
Copy link
Member

asmagill commented Jul 3, 2017

I've done very little with the spoons, so I defer to others, but for what it's worth, here's my two cents:

I agree with points 1 and 2 whole heartedly and would add that if you're replacing an existing spoon (i.e. upgrading it to a newer version) you should be prompted to confirm this as well (I haven't used the spoon feature in a while, so if this already happens then disregard)

As to 3... while I agree that it shouldn't be deleted when you do this, the whole point of it being a bundle is that it is just that... a bundle that the finder treats as a single unit even though it's really just a folder with specific contents. In this case I would think that Hammerspoon should just silently ignore the action of double clicking on it. @cmsj?

@z3t0
Copy link
Author

z3t0 commented Jul 3, 2017

I think a simple check here for whether the spoon is in the spoons directory would be perfect.

@cmsj
Copy link
Member

cmsj commented Jul 3, 2017

I agree with point 1.

Point 2 I'm a little less sure about - my intention here was to copy the way that Safari installs extensions, which it does by moving the bundle. The behaviour I had in mind was someone downloading a .zip of a Spoon with a browser, which would put it in ~/Downloads/ and unzip it, they open the spoon and Hammerspoon ingests it and tidies up their Downloads folder.

For point 3 we can just special case the spoons path and ignore open requests for that.

@cmsj
Copy link
Member

cmsj commented Jul 3, 2017

  • Display a confirmation dialog on spoon install/replace
  • Ignore spoon opens from ~/.hammerspoon/Spoons/

@cmsj cmsj changed the title Rename spoons after they are installed Spoon lifecycle behaviour tweaks Jul 3, 2017
@cmsj cmsj added this to the 0.9.55 milestone Jul 3, 2017
@z3t0
Copy link
Author

z3t0 commented Jul 3, 2017

Point 2 I'm a little less sure about - my intention here was to copy the way that Safari installs extensions, which it does by moving the bundle. The behaviour I had in mind was someone downloading a .zip of a Spoon with a browser, which would put it in ~/Downloads/ and unzip it, they open the spoon and Hammerspoon ingests it and tidies up their Downloads folder.

Yeah that makes sense. It was just a quirk that I found annoying when developing a Spoon. For example I like navigating in the terminal and occasionally using open . to launch a finder. Now whenever I would accidentally do this while inside the project it would try to install the spoon but then delete it or something and then it would be nowhere ....

I think just to be on the safe side it would be nice to be prompted whether or not we want it to be deleted. However, with the changes you have suggested above it's not a big deal.

@cmsj cmsj modified the milestones: 0.9.55, 0.9.56 Jul 17, 2017
@cmsj cmsj modified the milestones: 0.9.56, 0.9.57 Sep 15, 2017
@cmsj cmsj modified the milestones: 0.9.58, 1.0 Dec 25, 2017
@latenitefilms latenitefilms mentioned this issue Jan 18, 2018
19 tasks
@cmsj cmsj removed this from the 1.0 milestone Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants