Skip to content

jsimecek/black-touch-bar

Repository files navigation

black-touch-bar - 2026

A tiny macOS app that blacks out the Touch Bar.

No SIP changes, no sudo, no kernel hacks, just a black overlay using Apple's own (private) Touch Bar API with optional input monitoring permissions for optimized Cmd double-press detection.

Motivation

I know there is the popular Hide My Bar app for this, but I like my apps free and open source, so anyone can tweak them to their liking and check the code to make sure it's not doing anything malicious. Also, their app requires some troubleshooting hacks for it to work with Function Keys (F1, F2, etc...), where as this app works out of the box with every Touch Bar setup. It can also be triggered by the provided shell script, thus integrate with Apple Shortcuts or other automation tools.

How it works

There's no public API to control the Touch Bar backlight. BlackTouchBar works around this by presenting a system-modal black overlay that covers the entire Touch Bar display using undocumented NSTouchBar methods (the Hide My Bar app uses the same technique). To make it work with Function Keys and other setups, the app saves the current Touch Bar settings, switches to App Controls to do the blackout and restores them after the black overlay is removed. Input monitoring permissions are used to avoid triggering double Cmd presses on Cmd+key shortcuts (Cmd+C, etc.).

Requirements

  • macOS 12+ (Monterey or later)
  • MacBook Pro with Touch Bar
  • Input Monitoring permission (optional)

    System Settings > Privacy & Security > Input Monitoring > click + > select BlackTouchBar

Setup

Install from DMG

  1. Download BlackTouchBar.dmg from the Releases page
  2. Open the DMG and drag BlackTouchBar into Applications
  3. Remove the macOS quarantine flag (I do not pay for an Apple Developer account, so macOS will not let you run the app otherwise):
    xattr -cr /Applications/BlackTouchBar.app

Build from source

Requires Xcode Command Line Tools (xcode-select --install).

# 1. Clone the repo
git clone https://github.com/jsimecek/black-touch-bar.git BlackTouchBar
cd BlackTouchBar

# 2. Compile the Swift source into a .app bundle
mkdir -p BlackTouchBar.app/Contents/MacOS
swiftc -O BlackTouchBar.swift \
    -o BlackTouchBar.app/Contents/MacOS/BlackTouchBar \
    -framework AppKit

# 3. Add the Info.plist so macOS treats it as a background app (no Dock icon)
cp Info.plist BlackTouchBar.app/Contents/Info.plist

# 4. Move the app to /Applications
cp -R BlackTouchBar.app /Applications/

Create the DMG yourself

./create-dmg.sh

This compiles the app and packages it into BlackTouchBar.dmg with a drag-to-Applications layout.

Usage

Start the app

open /Applications/BlackTouchBar.app

The app now runs in the background.

Toggle the Touch Bar black

Method How
Double-press Cmd Press and release the Cmd key twice within 0.4 seconds
Shell script Run ./toggle-touchbar.sh (included in this repo)
macOS Shortcuts Create a shortcut that runs the shell script above

Auto-start at login

System Settings > General > Login Items > click + > select BlackTouchBar

Quit

The Touch Bar is automatically restored when the app exits. To quit:

pkill -x BlackTouchBar

Uninstall

rm -rf /Applications/BlackTouchBar.app

Troubleshooting

If the Touch Bar ever gets stuck, you can reset it by manually changing the mode in System Settings > Keyboard > Touch Bar Settings > Touch Bar shows.

License

MIT

About

A macOS app to toggle the MacBook Touch Bar on/off

Topics

Resources

License

Stars

Watchers

Forks

Contributors