Skip to content

macOS CLI that automatically hides app windows you're not using.

Notifications You must be signed in to change notification settings

shadowfax92/autohide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🫥 autohide

A macOS CLI that automatically hides app windows you're not using.

Switch to Chrome, and after 60 seconds Slack, Spotify, and everything else quietly disappear. Switch back and they're right where you left them. Your desktop stays clean without you thinking about it.

Also ships with a floating overlay timer for focus sessions — a small always-on-top widget that counts down while you work.

Install

Requires Go 1.21+ and Swift 5.9+ (for the overlay).

git clone https://github.com/your-user/mac-auto-hide.git
cd mac-auto-hide
sudo make install

This builds both autohide and autohide-overlay into /usr/local/bin.

Quick start

# Start the daemon (auto-starts on login)
autohide install

# That's it. Apps now auto-hide after 1 minute of inactivity.

Every command auto-starts the daemon if it isn't running, so you can also just jump straight in:

autohide status

Usage

Auto-hiding

autohide status                # check daemon state
autohide list                  # see tracked apps + time-to-hide
autohide pause                 # stop hiding (presenting, screen sharing)
autohide pause --duration 1h   # auto-resume after 1 hour
autohide resume                # resume hiding

Per-app configuration

# Never hide Terminal
autohide config set-app Terminal disabled true

# Give Slack 5 minutes before hiding
autohide config set-app Slack timeout 5m

# Change the global default to 2 minutes
autohide config set default_timeout 2m

# Or just edit the file directly
autohide config edit

Overlay timer

A floating countdown widget for focus sessions. Stays on top of all windows, visible on every desktop.

autohide overlay timer

autohide overlay start "API docs" 45m    # start a 45-minute session
autohide overlay pause                    # pause the countdown
autohide overlay resume                   # resume
autohide overlay hide                     # hide widget, timer keeps running
autohide overlay show                     # bring it back
autohide overlay status                   # check remaining time
autohide overlay stop                     # end session, dismiss widget

When the timer hits 0:00, the overlay turns red and stays visible until you stop or start a new session.

Configuration

Config lives at ~/.config/autohide/config.toml and is created with defaults on first run.

[general]
default_timeout = "1m"       # hide apps after this long
check_interval = "5s"        # how often to check
system_exclude = ["Finder"]  # never hide these

[apps]
  [apps.Finder]
  disabled = true

  [apps.Slack]
  timeout = "5m"

  [apps.Terminal]
  disabled = true

Changes take effect within 5 seconds — the daemon hot-reloads the config file.

How it works

autohide (CLI)  ── unix socket ──▶  autohide daemon (background)
                                         │
                                         ├── polls frontmost app via osascript every 5s
                                         ├── hides apps that exceed their timeout
                                         └── manages overlay timer + spawns overlay widget
  • No cgo. Talks to macOS through osascript (AppleScript via System Events).
  • No menu bar. Pure CLI. The daemon runs via launchd and restarts automatically.
  • Permissions: Requires Automation access in System Preferences > Privacy & Security for osascript to control app visibility.

Daemon management

autohide install     # install launchd plist + start on login
autohide uninstall   # remove plist + stop daemon
autohide start       # start via launchd
autohide stop        # stop via launchd
autohide daemon      # run in foreground (for debugging)

Logs: ~/.config/autohide/daemon.log

Project structure

mac-auto-hide/
├── Makefile                 # builds both targets
├── autohide/                # Go CLI + daemon
│   ├── cmd/                 # cobra commands
│   ├── config/              # TOML config
│   ├── daemon/              # poll loop, tracker, overlay manager, IPC server
│   └── ipc/                 # unix socket protocol + client
└── autohide-overlay/        # Swift floating timer widget
    ├── Package.swift
    └── Sources/

License

MIT

About

macOS CLI that automatically hides app windows you're not using.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages