github Hammerspoon/Hammerspoon2 1.0.0-beta.4
Hammerspoon 2 1.0.0 Beta 4

pre-release53 minutes ago

Added

  • hs.windowfilter, a replacement for v1's hs.window.filter: rule-based window filters with events for windows being created, focused, moved, minimized, and joining or leaving the filter (#470)
  • hs.distributednotifications, for listening to and posting macOS distributed notifications (e.g. Music's com.apple.Music.playerInfo) (#479)
  • hs.canvas.animate(), which animates changes to canvas elements and windows with linear, ease-in, ease-out, ease-in-out or custom bezier curves (#477)
  • HSChooser.windowID, the window ID of a shown chooser, for use with hs.window (#459)
  • HSChooser.frame, to read where a chooser is (or will be) on screen, and to move or resize it (#459)
  • hs.task.runAsync() and hs.task.shell() take an input option, a string written to the command's standard input, and TaskBuilder has withInput() (#461)
  • hs.checkForUpdates(), which checks for a new version of Hammerspoon 2 even when it's hidden from both the Dock and the menu bar (#466)
  • hs.spoons.updateAll(), which updates every installed Spoon, logging its progress to the Console and resolving with each Spoon's status (#467)
  • hs.spoons.isUpdating, which is true while hs.spoons.update() or hs.spoons.updateAll() is running (#467)
  • hs.window.frontmostWindow(), which returns the focused window, or the first ordered window if nothing has focus (#469)
  • HSWindow.role and HSWindow.subrole (#470)
  • HSWindow.windowsToEast()/West/North/South() and focusWindowEast()/West/North/South(), to find and focus the nearest window in a direction (#470)
  • Edit > Find… (⌘F) focuses the Console's search field (#473)
  • HSImage.toDataURL() and HSImage.toUint8Array(), which return an image's encoded bytes as a base64 data: URL or a Uint8Array without writing to disk (#478)
  • hs.windowfilter.inaccessibleApplications() and the inaccessibleApplication event, for applications that have turned the Accessibility API off (e.g. some kiosk setups), whose windows no filter can see (#480)

Changed

  • The API docs and TypeScript definitions now document each field of options objects and returned objects, such as hs.mqtt.create()'s options and hs.consoleHistory()'s messages (#460)
  • hs.spoons.updateAll() downloads each source once, however many Spoons were installed from it (#468)
  • hs.osascript scripts that try to show UI (e.g. display dialog) now fail straight away with "No user interaction allowed." instead of hanging forever (#482)

Fixed

  • Setting HSChooser.width after a chooser has been shown now resizes it (#459)
  • The API docs for hs.spoons.use() no longer render as a broken page (#460)
  • Parameter and return value descriptions in the API docs and TypeScript definitions are no longer cut off after their first line (#460)
  • hs.task.runAsync() and hs.task.shell() no longer hang forever when the command reads standard input; standard input is closed once any input has been written (#461)
  • Writing to a task's standard input after it has exited no longer crashes Hammerspoon, and sendInput() no longer blocks Hammerspoon while a large input is being read (#461)
  • Passing null for an optional callback (e.g. hs.task.create()'s onOutput) no longer logs "Unable to create JSCallback" (#465)
  • hs.window.focusedWindow() and isFocused now detect windows that take focus without activating their app, such as Spotlight (#469)
  • Installing several Spoons from the same repository at once (e.g. several hs.spoons.use() calls on first run) now downloads the repository once, not once per Spoon (#468)
  • The Console now always comes to the front when opened from the menu bar or hs.openConsole(), instead of sometimes appearing behind other apps (#473)
  • HSImage.saveToFile() now writes atomically, so other processes never read a partially written image (#476)
  • hs.ipc.start() no longer fails silently when macOS can't start the IPC broker; it re-registers the broker, and logs an error if that doesn't help (#475)
  • Hotkeys, hs.keycodes.map and hs.keycodes.on('change') follow a keyboard layout change right away, even while Hammerspoon 2 is in the background (#474)
  • hs.windowfilter no longer asks an application that has turned the Accessibility API off again every time it's activated (#480)
  • HammerspoonOSAScriptHelper no longer shows as "Not Responding" in Activity Monitor (#482)

Full Changelog: 1.0.0-beta.3...1.0.0-beta.4

Don't miss a new Hammerspoon2 release

NewReleases is sending notifications on new releases.