Skip to content

peter6366/CursorIdleHider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CursorIdleHider

A small macOS menu bar app that automatically hides the mouse cursor after a configurable period of inactivity, and shows it again as soon as the mouse moves.

Why this app exists

macOS has no built-in way to auto-hide an idle cursor system-wide (only certain apps, like video players, hide it in fullscreen). This fills that gap as a lightweight background utility.

How it works

  • Uses the private/undocumented CGSSetConnectionProperty with the key "SetsCursorInBackground" on this process's CGS connection. This lets CGDisplayHideCursor / CGDisplayShowCursor keep working even while the app isn't the frontmost application (normally these calls only affect the cursor while the calling process is key/frontmost).
  • A timer polls CGEventSource.secondsSinceLastEventType to measure how long the mouse has been idle, and hides/shows the cursor once it crosses the selected threshold.
  • Menu bar icon: SF Symbol cursorarrow.slash.

⚠️ Note on private API

SetsCursorInBackground is an undocumented CGS (Core Graphics Services) connection property. It could be removed or changed in a future macOS release, though it's been stable across many versions historically. If the app suddenly stops working after a system update, this is the first place to check.

Building from source

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

git clone <this-repo-url>
cd CursorIdleHider
./build_app.sh
mv CursorIdleHider.app /Applications/

Usage

Runs as a menu bar icon only (no Dock icon, no window). Menu:

  • Aktivní — checkbox, toggles the whole feature on/off
  • 1 / 2 / 3 / 5 / 10 / 15 / 20 / 30 s — idle threshold before the cursor hides
  • Konec — quit

(Menu labels are in Czech, matching the original build this was recovered from. Feel free to translate — it's a two-line change in main.swift.)

To launch automatically at login: System Settings → General → Login Items → + → select the app in /Applications.

License

Public domain / Unlicense — do whatever you want with it. See LICENSE.

About

CursorIdleHider

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors