Window Sweaters

A little Mac app I made to give my windows sweaters. 🧶 Knitted borders, colours inspired by your favourite apps, and a cosier desktop.

这是一个我制作的小型 Mac 应用,可以给你的窗口穿上毛衣。🧶 针织边框、灵感源自你最爱应用的配色,以及一个更温馨的桌面。

See Window Sweaters in action on X →

在 X 上查看 Window Sweaters 的实际效果 →

You can just send this repo to your coding agent and ask it to install Window Sweaters for you:

你可以直接将此仓库发送给你的编程代理,并让它为你安装 Window Sweaters:

Install Window Sweaters on my Mac: https://github.com/saragordic/window-sweaters

在我的 Mac 上安装 Window Sweaters:https://github.com/saragordic/window-sweaters

Or install it yourself with Homebrew:

或者使用 Homebrew 自行安装:

Then open Window Sweaters from your Applications folder.

然后从你的“应用程序”文件夹中打开 Window Sweaters。

You can also grab the latest ZIP from Releases, unzip it, and drag Window Sweaters.app into Applications.

你也可以从 Releases 获取最新的 ZIP 文件,解压后将 Window Sweaters.app 拖入“应用程序”文件夹。

If macOS blocks it, open System Settings → Privacy & Security → Open Anyway after trying to launch it. The app isn’t notarized by Apple yet. Apple’s instructions explain this step.

如果 macOS 阻止了它,请在尝试启动后打开“系统设置”→“隐私与安全性”→“仍然打开”。该应用尚未经过 Apple 公证。Apple 的说明文档解释了这一步骤。

Click the yarn icon in your menu bar to change the style, pattern, border width, and stitch size. You can also pause the sweaters or quit from there.

点击菜单栏中的毛线图标,即可更改样式、图案、边框宽度和针脚大小。你也可以在此处暂停毛衣效果或退出应用。

To leave an app bare, open Apps and untick it. Its windows lose their sweater straight away, everything else stays as it is, and it stays off until you tick it again, even after a restart. Only want sweaters on a few apps? Choose Turn Off for All Apps, then tick the ones you like. Apps you open later start off too.

若要让某个应用保持“裸露”状态,请打开“Apps”并取消勾选它。它的窗口会立即失去毛衣,其他一切保持不变,并且在重新勾选之前它会一直保持关闭状态,即使重启后也是如此。只想在少数几个应用上使用毛衣?选择“Turn Off for All Apps”(关闭所有应用的毛衣),然后勾选你喜欢的那些。之后打开的应用也会默认处于关闭状态。

By App gives each app its own sweater. Zigzag gives them all a softer, matching cream zigzag in colours taken from their icons. Try both and see what you like.

“By App”模式为每个应用提供专属毛衣。“Zigzag”模式则为所有应用提供更柔和、配色与图标相符的奶油色锯齿图案。两种模式都试试,看看你更喜欢哪一种。

If macOS asks for Accessibility access, enable Window Sweaters in System Settings → Privacy & Security → Accessibility so it can follow which window is focused.

如果 macOS 请求辅助功能权限,请在“系统设置”→“隐私与安全性”→“辅助功能”中启用 Window Sweaters,以便它能追踪当前聚焦的窗口。

Custom sweaters for 37 apps, and counting! Almost 40 little colourways, with colours picked by hand. These are just a few of my favourites:

已为 37 款应用定制了毛衣,且数量还在增加!近 40 种配色方案,颜色均为手工挑选。以下是我最喜欢的一些:

Shown above in By App and Zigzag. Here’s everyone we’ve knitted for so far:

上图展示了“By App”和“Zigzag”模式的效果。以下是我们目前已为其编织过毛衣的所有应用:

See every sweater and its close-up stitches in the catalogue, or download the By App PDF.

在目录中查看每一件毛衣及其针脚特写,或者下载“By App”PDF 文件。

The 37 custom sweaters keep their hand-picked colours and patterns. Other apps borrow colours from their own icons, softened into yarn, and get a two-colour zigzag, picnic or twinkle sweater in By App mode. The pattern stays the same for each app. If an icon has no usable colour, the app keeps a stable colour chosen from its name.

那 37 款定制毛衣保留了手工挑选的颜色和图案。其他应用则从各自的图标中提取颜色,并将其柔化为毛线质感,在“By App”模式下获得双色锯齿、野餐或闪烁图案的毛衣。每个应用的图案保持不变。如果图标没有可用的颜色,应用将使用从其名称中选出的固定颜色。

Icons are sampled locally in the background when needed. While the colour is being prepared, the border uses its usual fallback. Zigzag uses icon colours for every app, the 37 custom ones included, with a cream zigzag, or a deeper shade of the app’s colour on pale apps. Colours you set in apps.conf always win. Other shared patterns keep their own contrast yarns, with each app’s own base colour.

图标会在需要时在后台进行本地采样。在准备颜色期间,边框会使用默认的备用颜色。“Zigzag”模式对所有应用(包括那 37 款定制应用)均使用图标颜色,并配以奶油色锯齿,或者在浅色应用上使用该应用颜色的深色调。你在 apps.conf 中设置的颜色优先级最高。其他共享图案则保留各自的对比色毛线,并使用每个应用的基准颜色。

I built this on my Mac and use it myself, but there are still rough edges. Borders hide while you resize a window and return when you’re done.

这是我在自己的 Mac 上构建并自用的工具,但仍有一些瑕疵。当你调整窗口大小时,边框会隐藏,调整完成后会自动恢复。

The app is built for macOS 13 or later, on Apple Silicon and Intel. I’ve tested it on Apple Silicon with macOS 26; older macOS versions and Intel Macs haven’t had the same hands-on testing. It uses private macOS window APIs, so system updates may affect how it works.

该应用专为 macOS 13 或更高版本构建,支持 Apple Silicon 和 Intel 芯片。我已在搭载 macOS 26 的 Apple Silicon 设备上进行了测试;较旧的 macOS 版本和 Intel Mac 未经过同样的实机测试。它使用了 macOS 私有窗口 API,因此系统更新可能会影响其运行。

If something looks wrong, open an issue and tell me your macOS version, Mac model, and whether you’re using another screen. Reproduction steps help a lot.

如果发现异常,请提交 Issue 并告知你的 macOS 版本、Mac 型号以及是否使用了外接显示器。复现步骤非常有帮助。

You’ll need Apple’s Command Line Tools (xcode-select —install) and Python 3.

你需要安装 Apple 的命令行工具 (xcode-select —install) 和 Python 3。

This builds outputs/Window Sweaters.app, installs it in ~/Applications, and opens it. The installer backs up any previous local installation before replacing it.

此操作会构建 outputs/Window Sweaters.app,将其安装到 ~/Applications,并打开它。安装程序会在替换之前备份任何先前的本地安装。

If you’d like to experiment, edit these files and restart the app:

如果你想进行实验,请编辑这些文件并重启应用:

The folder still uses the app’s original name so existing settings keep working. For example, an app rule looks like this:

该文件夹仍使用应用的原始名称,因此现有的设置可以继续生效。例如,一条应用规则如下所示:

Names match app-name prefixes, ignoring capitalisation; the longest match wins. You can also put your own PNG charts in the charts folder to replace built-in patterns.

名称匹配应用名称的前缀,忽略大小写;最长匹配项优先。你也可以将自己的 PNG 图表放入 charts 文件夹中,以替换内置图案。

If you like setting things up from the command line, Window Sweaters also runs an optional shell script at startup, if you have one at ~/.config/window-sweaters/sweatersrc or ~/.sweatersrc.

如果你喜欢通过命令行进行设置,Window Sweaters 还会在启动时运行可选的 shell 脚本(如果你在 ~/.config/window-sweaters/sweatersrc 或 ~/.sweatersrc 中配置了该脚本)。

Quit Window Sweaters from the yarn icon first. Then, if you installed it with Homebrew:

首先通过毛线图标退出 Window Sweaters。然后,如果你是通过 Homebrew 安装的:

—zap also removes your saved colourways. Leave it off to keep them for later.

—zap 还会删除你保存的配色方案。如果不加此参数,则会保留它们以供日后使用。

If you installed it by hand, drag Window Sweaters.app to the Trash, then delete these if you want everything gone:

如果你是手动安装的,请将 Window Sweaters.app 拖入废纸篓,如果想彻底删除,请删除以下内容:

macOS remembers the Accessibility permission separately, so remove Window Sweaters from System Settings → Privacy & Security → Accessibility too.

macOS 会单独记录辅助功能权限,因此也请在“系统设置”→“隐私与安全性”→“辅助功能”中移除 Window Sweaters。

See CONTRIBUTING.md for more details.

详情请参阅 CONTRIBUTING.md。

Built on JankyBorders by Felix Kratz, with thanks. Released under GPL-3.0. See NOTICE.md for attribution.

基于 Felix Kratz 的 JankyBorders 构建,特此致谢。根据 GPL-3.0 协议发布。归属信息请参阅 NOTICE.md。

A macOS menu-bar app that dresses your windows in knitted borders.

一款为你的窗口穿上针织边框的 macOS 菜单栏应用。