This lightweight application is designed to prevent your computer from entering sleep mode by periodically moving the cursor when it detects periods of inactivity. Additionally, the program allows you to disable the keyboard programmatically (MacOS only).
For macOS systems, the installation of additional tools and development libraries is not needed.
You may require a proxy app which can convert the new DBus calls to the old format. More info in systray library info. For Debian-based systems with GTK based trays, use this script to install snixembed.
Verify that you have Go 1.26+ installed. If go is not installed, follow instructions on the Go website.
go install github.com/sonjek/mouse-stay-up/cmd/mouse-stay-up@latestThis should download the source code and compile the executable into $GOPATH/bin/mouse-stay-up.
Make sure $GOPATH/bin is in your $PATH so the shell can discover this application.
For example, my ~/.profile contains this:
export GOPATH="$HOME/go"
export PATH="$GOPATH/bin:$PATH"Alternatively, you can run this application using the full path /Users/<USERNAME>/go/bin/mouse-stay-up.
- Clone this repository
git clone https://github.com/sonjek/mouse-stay-up && cd mouse-stay-up- Build
make buildThe binary file is built and ready to run:
./bin/mouse-stay-up-
You can install the binary file to your OS.
Installs to
/usr/local/bin/by default:
make installor
sudo make installInstall to a custom location:
make install INSTALL_PATH=/tmp- Create a new file in
~/Library/LaunchAgents/calledcom.github.sonjek.mouse-stay-up.plistwith the following contents:
cat <<EOF > ~/Library/LaunchAgents/com.github.sonjek.mouse-stay-up.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.sonjek.mouse-stay-up</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/mouse-stay-up</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
<key>StandardOutPath</key>
<string>/tmp/mouse-stay-up.stdout.log</string>
<key>StandardErrorPath</key>
<string>/tmp/mouse-stay-up.stderr.log</string>
</dict>
</plist>
EOFor
cp deployments/com.github.sonjek.mouse-stay-up.plist ~/Library/LaunchAgents/com.github.sonjek.mouse-stay-up.plistIf you used go install, update the application path to /Users/<USERNAME>/go/bin/mouse-stay-up.
- Load the launch agent:
launchctl load ~/Library/LaunchAgents/com.github.sonjek.mouse-stay-up.plist- Accessibility permissions are required for the keyboard lock to function. Please grant these permissions in settings to enable this feature:
- Go to
System Settings > Privacy & Security > Accessibility. - Enable
mouse-stay-up.
- To disable background activity:
- Go to
System Settings > General > Login Items & Extensions. - Disable
mouse-stay-upin app background activity section.