Scripts2026年7月2日·1 分钟阅读

SketchyBar — Customizable macOS Status Bar Replacement

SketchyBar is a highly customizable macOS status bar replacement written in C. It allows users to create fully scripted bar items with animations, graphs, and event-driven updates.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
SketchyBar Overview
直接安装命令
npx -y tokrepo@latest install ddf6b8f3-7615-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

SketchyBar is an open-source status bar replacement for macOS written in C. It is designed for users who want full control over every element displayed in their menu bar. Each bar item is defined through shell scripts, making the bar entirely programmable and responsive to system events. It pairs well with tiling window managers like yabai.

What SketchyBar Does

  • Renders a fully custom status bar that replaces or overlays the default macOS menu bar
  • Supports scripted bar items that update dynamically based on shell commands or event triggers
  • Provides built-in drawing primitives including graphs, sliders, and background shapes
  • Handles mouse click events on bar items with configurable callback scripts
  • Supports multiple displays with independent bar configurations per monitor

Architecture Overview

SketchyBar is written in C and communicates with macOS through the CoreGraphics and SkyLight private frameworks to draw directly on the screen. It runs as a lightweight daemon process that reads a shell configuration file on startup. Bar items are defined via command-line messages sent to the running process. Each item can have associated scripts triggered by events such as system wake, space changes, or periodic timers. The bar renders using CoreGraphics, achieving smooth animations at low CPU cost.

Self-Hosting & Configuration

  • Install via Homebrew from the FelixKratz tap
  • Configuration lives in ~/.config/sketchybar/sketchybarrc, a bash script executed at launch
  • Bar items are added and configured using the sketchybar CLI with --add, --set, and --subscribe commands
  • Custom plugins are shell scripts placed in a plugins directory and referenced by item definitions
  • Requires macOS 12 (Monterey) or later; works with both Intel and Apple Silicon

Key Features

  • Extremely low resource usage due to native C implementation
  • Smooth animations for item transitions, graph updates, and bar toggling
  • Event subscription system allowing items to react to system and custom events
  • Support for SF Symbols, custom icon fonts, and images in bar items
  • Fully transparent to the window manager, compatible with yabai and Amethyst

Comparison with Similar Tools

  • macOS default menu bar — not customizable beyond showing or hiding built-in icons
  • BitBar / xbar — displays script output in the menu bar but cannot replace the bar itself or animate items
  • Polybar — highly customizable status bar for Linux (X11) but not available on macOS
  • Waybar — status bar for Wayland compositors on Linux, similar concept but different platform
  • Simple Bar (Uebersicht widget) — a Uebersicht widget providing a custom bar, but depends on the Uebersicht runtime and uses more resources

FAQ

Q: Can SketchyBar run alongside the default macOS menu bar? A: Yes. You can run SketchyBar as an overlay without hiding the system menu bar, or hide the system bar entirely via System Settings for a clean look.

Q: How do I add a battery indicator or CPU graph? A: Write a shell script that outputs the desired value (e.g., pmset -g batt), then register it as a bar item with a periodic update interval in your sketchybarrc.

Q: Does SketchyBar work with yabai? A: Yes. SketchyBar is commonly used alongside yabai. It can subscribe to yabai events like space changes and window focus to display workspace information.

Q: Is there a GUI for configuring SketchyBar? A: No. All configuration is done through the shell-based rc file and CLI commands. Community-shared dotfiles provide good starting points.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产