Hammerspoon / hammerspoon

Staggeringly powerful macOS desktop automation with Lua
http://www.hammerspoon.org
MIT License
11.92k stars 578 forks source link

Release 0.9.53 #1305

Closed cmsj closed 7 years ago

cmsj commented 7 years ago

It feels like we're on the home stretch for a bunch of work, so let's get our ducks in a row for 0.9.53.

Usual drill, please nominate anything for the milestone that you want/need urgently fixed/added

latenitefilms commented 7 years ago

My Wishlist:

...and some others, that might not be suitable for 0.9.53:

MichaelHindley commented 7 years ago

Fixing the problem with repeating keys which make any type of navigation or repeating tasks unusably inconsistent: #1156, #1179, #1178, #1308

latenitefilms commented 7 years ago

@MichaelHindley - Curious... have all your tests been on macOS 10.12? Have you tested on 10.11 as well? Any difference?

MichaelHindley commented 7 years ago

@latenitefilms no, I don't have access to a 10.11 machine, and I was not a user of hammerspoon at that time, so I can't answer to the timeline aspect of this issue.

MichaelHindley commented 7 years ago

sorry was a bit quick, yes, ALL tests were on 10.12 :)

latenitefilms commented 7 years ago

No worries, thanks for the fast reply! I personally seem to have a lot more issues with Hammerspoon in 10.12 than 10.11, but it's proving diffierent to work out what's going on exactly, so that people smarter than I can fix it. Apple's obviously changed SOMETHING - hopefully someone can work out what.

cmsj commented 7 years ago

@asmagill How do you feel about your hs.drawing->hs.canvas wrapper? Shall we flip it on by default and see if anyone notices? :)

cmsj commented 7 years ago

@MichaelHindley I'll try and find some time to look at the hotkey stuff, but I continue to think that it's generally not a good idea to be emitting keyboard events while you're holding down keyboard keys. I know it's something that people are looking to Hammerspoon to solve, in the absence of the complex remapping features of Karabiner, on Sierra, but we're just running at the wrong layer of the OS to be doing truly powerful things with keyboards. That stuff needs to happen in the kernel, and that's somewhere we're not going to go.

What I would say is that some commits in the last few days on Karabiner Elements look to me like the groundwork is being laid there for complex remapping, so I'm hopeful that it won't be too much longer until usable builds are available which let people do the kinds of things you're looking for, in the part of the OS where they should be happening :)

cmsj commented 7 years ago

(and I would encourage everyone who cares about getting awesome Karabiner features back, to go and donate to @tekezo via https://pqrs.org/osx/karabiner/pricing.html.en )

cmsj commented 7 years ago

@asmagill I just had a look at the 0.9.53 milestone and it seems like too much of the stuff in there ends up pointing at you. I have no desire to be ordering you around, so please take a look and bump anything of yours that you're not ready to land :)

latenitefilms commented 7 years ago

That stuff needs to happen in the kernel, and that's somewhere we're not going to go.

I wonder if this is the kind of thing that could be offered as an optional "spoon"? I know you don't want Hammerspoon to start messing with the Kernel, but in theory, I guess a "spoon" could offer this functionality for anyone who wants to "risk it"?

cmsj commented 7 years ago

@latenitefilms well there's also my dogmatic refusal to allow binaries in Spoons, but ultimately I can't stop people from doing whatever they want with them. I think it's unlikely to happen though, you need to be really deeply knowledgeable about the kernel and how HID systems work, and outside of Apple, the best people at doing that stuff already have their own great projects :)

but sure, someone could fork Karabiner Elements when it's a bit more ready, and instead of its UI communicating with the kernel module, a Hammerspoon extension/Spoon could be communicating with it to map hotkeys and emit events.

asmagill commented 7 years ago

@cmsj, by binaries are you including libraries in that definition (for example, the shared library portion of what we currently consider a third-party module)?

@latenitefilms, WRT to doing things in kernel land, I can see this as potentially having two parts. The first part being elevated access (e.g. when an application asks for an Administrator password)... my understanding of the "proper" way to do this (admittedly very limited understanding because I decided it wasn't a direction I was really comfortable for Hammerspoon to go in considering the alternatives proposed in #707) is to register a "helper application" along with your Application in it's Info.plist file and then it's actually the helper which performs the elevated tasks, not the primary application... I know that with sandboxed apps (which Hammerspoon is not) the helper must be in a specific place in the Application's bundle... not sure if that's required or not for un-sandboxed, but I would expect it to be... so 2 strikes right there for a spoon being a solution.

The second part, and probably the most important when doing kernel level things is that this usually requires a driver or kext to be written as well because we're adding or extending or removing something at the kernel level, not the application level... this too cannot live in the spoon directory but will have to be installed in specific system folders, require root access to install/remove, and probably require a reboot as well.

Now the idea of a fork allowing some sort of external control... that does sound appealing... keep the expertise of each where it can do the most good.

asmagill commented 7 years ago

(And I'm sure I have some of the specifics above wrong... I did say my understanding of what's required was pretty superficial!)

latenitefilms commented 7 years ago

That all makes sense. I guess my point was that if someone far smarter than I wanted to make a "spoon" that allowed Karabiner-like power and functionality - then the spoon bundle could contain the kernel "helper" files, and all you need to do in your init.lua is use Terminal or AppleScript commands to "install" the helper. Similar to the way hs.ipc.cliInstall() works I guess.

Either way, given basic Objective-C is already above my head, I doubt I'll be personally messing with the Kernel space anytime soon!

asmagill commented 7 years ago

Ok, my comments re the items I think I can get to in the next couple of days and what should hold off:

Probables:

Less-Probables, or "Are you $#^$@#%^@$#$ crazy?" 😜:

asmagill commented 7 years ago

In any case, I do think I can get to this by Sunday, so... unless you're really in a hurry for 53, it shouldn't delay things much if at all.

cmsj commented 7 years ago

@asmagill re binaries in Spoons - yes, I mean the .so's. I've very intentionally not added the Spoons folder to package.cpath. I think the Spoons should be for distributing units of Lua functionality. Something reasonably safe that users can install without worrying too much. If we add them to cpath too then everything goes out the window, and we start having to worry about stable ABIs.

I really really do not want to encourage any kind of .so support in Spoons. I can't stop people from choosing to do it, but I won't be adding any support for it to Hammerspoon, nor will I be merging any Spoons that use it, to the official Spoons repository.

To be very clear, I love that you distribute unfinished/experimental/undocumented/etc extensions for people to play with, and I'm 100% fine with that - it's useful and fun, and they are taking ownership of managing them, by having to drop them into .hammerspoon. Spoons are just supposed to be something different - a way for users to stand on each others' shoulders for creating their configs.

I've now switched over to running a Release build of master, and moved a few of my own self-contained config items into Spoons, and the relevant section of my init.lua is: https://github.com/cmsj/hammerspoon-config/blob/master/init.lua#L42-L56 and I'm pretty happy with the way this is working so far :)

cmsj commented 7 years ago

@asmagill ok, I think I've updated all the 0.9.53 milestones. There's no immediate rush to release - I'd like to do it soonish, because we haven't had a release this year yet, but a few days makes no difference, and any of the things on the milestone can be bumped if needs be :)

cmsj commented 7 years ago

(also if people don't know, you can click on the 0.9.53 in the milestone box on this issue, and get taken to https://github.com/Hammerspoon/hammerspoon/milestone/10 to see the list)

latenitefilms commented 7 years ago
  • Add API to allow drag & drop support to Hammerspoon Dock Icon and/or Menubar. See: #1057

-- As I understand it, this requires a move to custom NSViews... which is something we should do for hs.menubar anyways since much of what we're doing in the module is deprecated or not recommended. But I see that as more of a 9.9.54 item unless someone disagrees.

It sounds like drag & drop to the hs.menubar is definitely something that can only be done after hs.menubar is revamped to use NSViews - however, I wonder if it's worth adding a callback when you drag and drop stuff to the Hammerspoon dock item? Hammerspoon can already handle "spoon" files, so I wonder if it's worth adding an interface to support the dragging and dropping of other arbitrary things? Maybe support for both files and text? I'm happy to give this a bash over the weekend and see what I can uncover. I'm thinking that if you drag and drop text onto the Hammerspoon dock icon, then it could trigger a Lua callback that allow you to do "something" with that text, or if it's a file, the callback would give you the path to that file.

latenitefilms commented 7 years ago

For anyone who's interested, #1177 could probably also be included in 0.9.53.

krasnovpro commented 7 years ago

I improved hammerspoon documentation pages with this userscript: https://openuserjs.org/scripts/krasnovpro/hammerspoon.org_Documentation

It restyle all and add iframe with toc: https://habrastorage.org/files/898/166/977/8981669778e24f80acae56e6d5c192ea.png

latenitefilms commented 7 years ago

That looks awesome!

asmagill commented 7 years ago

@krasnovpro it looks like I can make this a part of the built in document browser and web server provided by hs.doc.hsdocs by using script injection, if you have no objections.

krasnovpro commented 7 years ago

It would be nice. But check for bugs, just in case. I'm not a programmer.

krasnovpro commented 7 years ago

Some fantasy about logo: hs Looks like a tank =)

cmsj commented 7 years ago

1352 is the only remaining item milestoned against 0.9.53, so let's try something a little new, and do a Release Candidate build :)

Hammerspoon.app.zip

cmsj commented 7 years ago

@krasnovpro I like it, but I'm also very attached to our current logo :)

cmsj commented 7 years ago

(in case it wasn't clear - that .zip is a release build of 0.9.53, with only the following details:

cmsj commented 7 years ago

Thanks very much everyone who contributed to this release, I think it's a really good one :)

Approximately final number for the ~4 months of 0.9.52's life:

Hammerspoon-0.9.52.zip: 20314 downloads