A powerful bash script with a beautiful macOS UI that automatically clicks at custom coordinates with a custom interval using cliclick to prevent your macOS system from going idle or AFK.
Perfect for keeping your Mac active during long-running tasks, preventing screen savers, or maintaining online status.
- β macOS Native UI - Beautiful SwiftUI app with menu bar integration
- β Configuration Persistence - Saves your settings automatically
- β Simple Configuration - Set intervals in seconds
- β Background Mode - Run in the background as a daemon
- β Status Checking - Check if an instance is already running
- β File Logging - Optional logging to file with timestamps
- β Screen Validation - Warns if coordinates are outside screen bounds
- β Better Error Handling - Graceful error handling and cleanup
- β Command-Line Interface - Use via CLI or interactive mode
- β Multiple Instances Prevention - Prevents running multiple instances simultaneously
- macOS 13.0 or later (for the UI app)
- Xcode 14.0 or later (for building the UI app)
- Homebrew (for automatic installation, optional)
- cliclick (installed automatically via installer)
π Quick Start: See docs/getting-started/QUICK_INSTALL.md for a simple installation guide
Option 1: macOS App with UI (PKG Installer) - Recommended
- Go to Releases
- Download
DontBeAFK-Installer-1.0.pkg - Double-click to install
- Open from Applications folder
- Grant accessibility permissions when prompted
Option 2: Command Line Version (CLI)
- Go to Releases
- Download
dont-be-afk-cli-macos-1.0.0.tar.gz - Extract:
tar -xzf dont-be-afk-cli-macos-1.0.0.tar.gz - Install:
cd dont-be-afk-cli && ./install.sh - Use:
dont-be-afk
# Clone the repository
git clone https://github.com/YOUR_USERNAME/dont-be-afk.git
cd dont-be-afk
# Run the CLI installer (installs dependencies and makes scripts executable)
./cli/install.sh
# Start using it!
dont-be-afkOption 1: Automated Installer (Recommended)
./cli/install.shThe installer automatically:
- β Checks and installs Homebrew (if needed)
- β Installs cliclick dependency
- β Makes all scripts executable
- β
Optionally installs to
/usr/local/binfor global access
Option 2: Manual Installation See docs/getting-started/INSTALL.md for step-by-step manual installation instructions.
After installation, you can run dont-be-afk from anywhere!
The project includes a native macOS SwiftUI app for easy control:
-
Download the installer:
- Go to Releases
- Download
DontBeAFK-Installer-1.0.pkg
-
Install:
- Double-click the
.pkgfile - Follow the installer wizard
- Enter your admin password when prompted
- The app will be installed to
/Applications
- Double-click the
-
Open the project in Xcode:
open app/DontBeAFK.xcodeproj
-
Build and run:
- Press
Cmd+Ror click the Run button in Xcode - The app will appear in your menu bar with a cursor icon
- Press
-
Or build from command line:
./scripts/build/build-app.sh
To create your own installer package:
./scripts/release/create-installer.shThis creates a .pkg installer and optionally a .dmg disk image. See docs/release/INSTALLER.md for details.
- Click the menu bar icon to see quick status and controls
- Click "Open Settings" to access the full control panel
- Configure coordinates, interval, and logging preferences
- Start/stop the automation with a single click
- View logs directly from the app
The UI app provides:
- π― Visual Status Indicator - See at a glance if automation is running
- βοΈ Easy Configuration - Set coordinates and interval with a friendly interface
- π Log Viewer - View logs without opening terminal
- π Quick Start/Stop - Control automation from menu bar or main window
- πΎ Auto-save Settings - Your preferences are saved automatically
- Clone or download this repository
- Make the script executable:
chmod +x cli/bin/dont-be-afk
- Install dependencies:
brew install cliclick
- Run the script:
./cli/bin/dont-be-afk
Simply run the script without arguments:
./dont-be-afk.shThe script will:
- β Check if cliclick is installed
- π§ Offer to install cliclick via Homebrew if not found
- π Prompt you to set custom click coordinates (or use saved ones)
- β° Prompt you to set custom click interval (or use saved ones)
- π±οΈ Start clicking at your specified coordinates with your specified interval
- π Log each click with timestamp
- βΉοΈ Run continuously until stopped with
Ctrl+C
Start with specific settings:
./dont-be-afk.sh start -x 100 -y 200 -i 300Start in background mode with logging:
./dont-be-afk.sh start --background --logstart- Start the automation (default command)stop- Stop a running instancestatus- Check if an instance is runninghelp- Show help message
-x, --x-coord NUM- X coordinate (default: 500)-y, --y-coord NUM- Y coordinate (default: 300)-i, --interval SECONDS- Interval in seconds (default: 600)-b, --background- Run in background mode-l, --log- Enable logging to file (~/.dont-be-afk.log)-c, --config- Show current configuration
# Interactive mode (recommended for first-time use)
./dont-be-afk.sh
# Start with specific coordinates and interval
./dont-be-afk.sh start -x 100 -y 200 -i 300
# Start in background with logging
./dont-be-afk.sh start --background --log
# Start with 30-minute interval (1800 seconds)
./dont-be-afk.sh start -i 1800
# Check if instance is running
./dont-be-afk.sh status
# Stop running instance
./dont-be-afk.sh stop
# View current configuration
./dont-be-afk.sh --configIntervals are specified in seconds only. Examples:
300= 5 minutes600= 10 minutes (default)1800= 30 minutes3600= 1 hour
The script automatically saves your configuration to ~/.dont-be-afk-config. This includes:
- Click coordinates (X, Y)
- Click interval
- Logging preference
On subsequent runs, the script will offer to use your saved settings, making it faster to start.
~/.dont-be-afk-config- Configuration file (coordinates, interval, etc.)~/.dont-be-afk.pid- Process ID file (created when running, removed on exit)~/.dont-be-afk.log- Log file (only if logging is enabled)
You may need to grant accessibility permissions to your terminal app:
- Go to System Preferences β Security & Privacy β Accessibility
- Add your terminal app (Terminal, iTerm2, etc.) to the allowed list
Without these permissions, the script will fail to click and log errors.
When running in background mode:
./dont-be-afk.sh start --background- The script runs as a background process
- You can close your terminal without stopping it
- Use
./dont-be-afk.sh stopto stop it - Use
./dont-be-afk.sh statusto check if it's running
Enable file logging to track all clicks:
./dont-be-afk.sh start --logLogs are written to ~/.dont-be-afk.log with timestamps:
[2026-01-26 10:30:45] π Starting automation
[2026-01-26 10:30:45] π Coordinates: (500, 300)
[2026-01-26 10:30:45] β° Interval: 600 seconds
[2026-01-26 10:40:45] β
Click #1 at (500, 300)
[2026-01-26 10:50:45] β
Click #2 at (500, 300)
- Screen Bounds Validation: Warns if coordinates are outside screen resolution
- Multiple Instance Prevention: Prevents running multiple instances simultaneously
- Graceful Shutdown: Proper cleanup on exit (Ctrl+C)
- Error Handling: Handles cliclick failures and permission issues gracefully
- Check accessibility permissions (see Permissions section above)
- Verify coordinates are within screen bounds
- Check logs:
cat ~/.dont-be-afk.log
./dont-be-afk.sh stopIf that doesn't work, find and kill the process:
ps aux | grep dont-be-afk
kill <PID>Delete the config file to reset:
rm ~/.dont-be-afk-configdont-be-afk/
βββ cli/ # Command Line Interface
β βββ bin/
β β βββ dont-be-afk # Main executable script
β βββ lib/ # Script modules
β β βββ click.sh # Click automation
β β βββ config.sh # Configuration management
β β βββ input.sh # User input handling
β β βββ install.sh # Installation helpers
β β βββ logger.sh # Logging functionality
β β βββ process.sh # Process management
β β βββ source-all.sh # Module loader
β β βββ utils.sh # Utility functions
β β βββ validation.sh # Input validation
β βββ install.sh # CLI installer
β
βββ app/ # macOS UI Application
β βββ DontBeAFK/ # Swift source files
β β βββ App/ # App entry point
β β βββ Assets.xcassets/ # App icons and assets
β β βββ Components/ # Reusable UI components
β β βββ Controllers/ # Script controller
β β βββ Overlay/ # Overlay window
β β βββ Views/ # SwiftUI views
β βββ DontBeAFK.xcodeproj/ # Xcode project
β βββ project.yml # xcodegen configuration
β
βββ scripts/ # Build & release scripts
β βββ build/
β β βββ build-app.sh # Build macOS app
β β βββ setup-project.sh # Setup Xcode project
β βββ release/
β β βββ create-dmg.sh # Create .dmg disk image
β β βββ create-installer.sh # Create .pkg installer
β β βββ create-release.sh # Create release files
β β βββ package-cli.sh # Package CLI for release
β βββ pkg/ # Installer resources
β βββ distribution.xml
β βββ resources/
β βββ scripts/
β
βββ docs/ # Documentation
β βββ getting-started/
β β βββ INSTALL.md # Installation guide
β β βββ QUICK_INSTALL.md # Quick start guide
β βββ development/
β β βββ BUILD_UI.md # Building the UI app
β β βββ CONTRIBUTING.md # Contributing guidelines
β β βββ SECURITY.md # Security policy
β β βββ SETUP_XCODE.md # Xcode setup guide
β βββ release/
β βββ GITHUB_RELEASE.md # GitHub release guide
β βββ INSTALLER.md # Installer creation guide
β βββ RELEASE_CHECKLIST.md # Release checklist
β
βββ .github/ # GitHub configuration
β βββ ISSUE_TEMPLATE/
β βββ workflows/
β βββ pull_request_template.md
β
βββ README.md
βββ LICENSE
βββ CHANGELOG.md
Contributions are welcome! Please see docs/development/CONTRIBUTING.md for guidelines.
Before contributing:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please see docs/development/SECURITY.md for information about security vulnerabilities and reporting.
Erbil Nas - Creator and maintainer
This project is free and open source software, licensed under the MIT License - see the LICENSE file for details.
You are free to use, modify, and distribute this software for any purpose, including commercial use.
- Built with cliclick for macOS automation
- Uses SwiftUI for the native macOS interface
If you find this project useful, please consider giving it a β on GitHub!