PressyBar is a lightweight macOS menu bar app that simulates Caps Lock key presses at random intervals to prevent idle lockouts or sleep triggers. It's useful in environments where periodic user activity is expected to keep sessions active.
- Lives in the macOS menu bar
- Start/Stop control for keypress simulation
- Randomized Caps Lock presses every 10–50 seconds
- Dynamic icon: filled
capslock.fillwhen active,capslockwhen stopped - Fully native Swift app (no Python dependencies)
- macOS 11.0 or later
- Swift 5.7+ toolchain installed (
swiftCLI) - Accessibility permissions enabled for the app
git clone https://github.com/yourusername/PressyBar.git
cd PressyBar2. Install Taskfile.dev CLI tool
brew install go-task/tap/go-tasktaskThis will:
- Build the Swift binary
- Create a
.appbundle atPackages/PressyBar.app - Open the app
task installThis will:
- Move the app into user's Application folder. This makes it visible to the wider system.
The .app bundle will be generated in:
Packages/PressyBar.app/
├── Contents/
│ ├── Info.plist
│ ├── MacOS/
│ │ └── PressyBar
│ └── Resources/
The
Info.plistsetsLSUIElement = trueso the app runs only in the menu bar (no Dock icon or Cmd+Tab presence).
To simulate key presses, you must allow access:
- Go to System Settings → Privacy & Security → Accessibility
- Click
+, addPackages/PressyBar.app - Ensure it's checked ✅
.
├── Taskfile.yml # Build automation using taskfile.dev
├── Package.swift # SwiftPM project definition
└── Sources/
└── PressyBar/
└── main.swift # App logic and keypress simulation
MIT © 2025 [KusW3]
To have it start on login:
- Add
Packages/PressyBar.appto Login Items in System Settings