锤子精灵 (Chuízi Jīnglíng)
Hammerspoon

原始链接: https://github.com/Hammerspoon/hammerspoon

## Hammerspoon:使用 Lua 进行 macOS 自动化 Hammerspoon 是一款强大的 macOS 自动化工具,它将操作系统与 Lua 脚本语言连接起来。它允许用户通过 Lua 脚本和一套系统功能扩展来控制和自定义他们的 Mac 环境。 与它的前身 Mjolnir 不同,Hammerspoon 提供了更集成的体验,其扩展内置其中。要开始使用,请下载应用程序并在 `~/.hammerspoon/` 中创建一个 `init.lua` 文件来编写你的自动化脚本。 该项目专注于不断扩展其系统 API 覆盖范围,改进扩展集成,并简化整体用户体验。本质上,Hammerspoon 赋予用户通过灵活的脚本来深度个性化和自动化他们的 macOS 工作流程的能力。

## Hacker News 上关于 Hammerspoon 的讨论 最近 Hacker News 上的一场讨论强调了 **Hammerspoon**,一个强大的 macOS 自动化工具 ([github.com/hammerspoon](https://github.com/hammerspoon))。维护者宣布正在开发版本 2,将从 Lua 切换到 JavaScript,引发了用户之间的争论。一些人惋惜失去 Lua,而另一些人则认为 JavaScript 是一个务实的選擇。 用户分享了 Hammerspoon 实用性的广泛示例,包括窗口管理(与 AeroSpace 等集成)、应用程序控制、系统自动化(例如将 Safari 标签转储到 Obsidian)和自定义按键绑定。许多人认为它对于他们的 macOS 工作流程至关重要,填补了 Apple 内置工具留下的空白。 一些用户推荐了互补工具,如 Karabiner-Elements、AutoHotkey(用于 Windows 对比)和 PaperWM。对话还涉及了配置同步的挑战以及使用 QMK 等框架进行键盘定制的好处。总而言之,该帖子展示了一个充满激情的社区,他们依赖 Hammerspoon 的灵活性和强大功能来实现深度定制的 macOS 体验。
相关文章

原文

CI codecov.io Downloads current release Downloads all releases Latest tag Latest release

Discord: Click to join

This is a tool for powerful automation of OS X. At its core, Hammerspoon is just a bridge between the operating system and a Lua scripting engine.

What gives Hammerspoon its power is a set of extensions that expose specific pieces of system functionality, to the user. With these, you can write Lua scripts to control many aspects of your OS X environment.

  • Download the latest release
  • Drag Hammerspoon.app from your Downloads folder to Applications
  • brew install hammerspoon --cask

Out of the box, Hammerspoon does nothing - you will need to create ~/.hammerspoon/init.lua and fill it with useful code. There are several resources which can help you:

What is the history of the project?

Hammerspoon is a fork of Mjolnir. Mjolnir aims to be a very minimal application, with its extensions hosted externally and managed using a Lua package manager. We wanted to provide a more integrated experience.

What is the future of the project?

Our intentions for Hammerspoon broadly fall into these categories:

  • Ever wider coverage of system APIs in Extensions
  • Tighter integration between extensions
  • Smoother user experience
联系我们 contact @ memedata.com