Repository navigation
Hammerspoon 2 0.0.17
Added
HSMenuBarItem.titleColor, to colour a menu bar item's title (#354)- A
colorkey forhs.menubarandhs.dockiconmenu entries, to colour their titles (#354) hs.bluetooth, for listing paired and connected Bluetooth devices, their battery levels, connecting and disconnecting them, scanning for nearby devices, reading and writing Bluetooth LE characteristics, and watching for connections and Bluetooth being turned on or off (#357)hs.permissions.checkBluetooth()andhs.permissions.requestBluetooth()(#357)- Hammerspoon 2 can now request access to calendars and reminders, so scripts can read them via EventKit (e.g. JXA in
hs.osascript, or tools run withhs.task) (#362) HSUIWindow.behavior()andHSUIWindow.behaviorList(), to make a window appear on every Space or over fullscreen apps (e.g.behaviorList(["canJoinAllSpaces", "fullScreenAuxiliary"])) (#364)hs.choosernow supports Page Up / Page Down (or Fn-↑ / Fn-↓) to move through results a page at a time, and Home / End (or Fn-← / Fn-→) to jump to the first / last result (#369)hs.wifi.configuration()andhs.wifi.cachedScanResults(), which return the configuration and cached scan results that used to be part ofhs.wifi.interfaceDetails()(#370)hs.spoons.use(), which installs a Spoon from a GitHub repository or zip URL if it isn't installed, then loads and configures it, like v1's SpoonInstall (#372)hs.spoons.install(),hs.spoons.update(),hs.spoons.uninstall(),hs.spoons.available()andhs.spoons.installed(), for managing Spoons from GitHub repositories or zip URLs (#372)- An "Install Spoons when opened" setting in the Advanced settings tab that turns off automatic installation of double-clicked
.spoon2bundles (#373) hs.chooserchoices can opt out of the context menu withcontextMenu: falsehs.socket, for communicating over raw TCP, UDP and Unix domain socketsHSSocket.enableServerTLS()andHSSocket.enableServerTLSFromKeychain(), which make a listening socket use TLS with a certificate from a PKCS#12 file or the keychainHSSocket.listen()andHSUDPSocket.bind()take an optional local IP address, to accept connections or datagrams on just that addressHSSocket.state,HSSocket.connectTimeoutandHSSocket.readTimeout, and an optionallossyargument tohs.socket.decodeText()hs.mqtt, an MQTT client for publishing and subscribing to brokers- Hammerspoon 2 offers to report a crash as a GitHub issue the next time it launches
Changed
HSUIWindow.level()andHSUIWindow.windowTitle()now update a window that's already shown (#364)hs.wifi.interfaceDetails()no longer includesconfigurationorcachedScanResults, because fetching them leaks memory inside macOS. Usehs.wifi.configuration()andhs.wifi.cachedScanResults()instead (#370)hs.loadSpoon()is nowhs.spoons.load(), and its errors have acode(#372)- Console results are now formatted like
console.log()output (e.g. booleans print astrue/false, objects as{ a: 1 }) (#378) hs.choosercontext menus are now set once for the whole chooser withcontextMenu, and report the picked entry and row to a singleonContextMenuSelectcallback, instead of each choice having its owncontextMenuwith anactionper entry
Fixed
HSWindow.isFocusednow returns true for the focused window (#358)console.log()of Hammerspoon objects (e.g. anHSApplication) printedundefined {}instead of a description of the object (#359)hs.window:focus()now keeps the requested window in front in applications such as Google Chrome that bring their previous window back after activating (#361)HSCanvas.behaviorList()andHSCanvas.behaviorValue()no longer crash Hammerspoon when given mutually exclusive behaviors (e.g.canJoinAllSpaceswithmoveToActiveSpace) or a negative bitmask; they throw an Error instead (#364)- Reloading the configuration no longer leaks the previous JavaScript environment's memory if
fetch()was used (#366) - Polling
hs.wifi.interfaceDetails()no longer makes Hammerspoon's memory use grow steadily (#370) - Errors in Promises that nothing handles, such as a Spoon that fails to load in
hs.spoons.use(), are now logged to the Console instead of disappearing (#372) - Hammerspoon could freeze when updating an
hs.chooser's choices while its callbacks were being garbage collected (#376) hs.timer.doAt()now repeats atrepeatIntervalinstead of only firing once
Full Changelog: 0.0.16...0.0.17