#!/bin/bash # SleepToggle uninstaller — https://sleep.138.dk # Removes the app, the LaunchAgent, the sudo rule, and re-enables normal sleep. set -uo pipefail LABEL="com.sleeptoggle" launchctl bootout "gui/$(id -u)/$LABEL" 2>/dev/null || true pkill -x SleepToggle 2>/dev/null || true rm -rf "$HOME/Applications/SleepToggle.app" "$HOME/Library/LaunchAgents/$LABEL.plist" if [ -f /etc/sudoers.d/pmset-disablesleep ]; then echo "→ re-enabling normal sleep + removing the sudo rule (asks for your password)" sudo /usr/bin/pmset -a disablesleep 0 || true sudo rm -f /etc/sudoers.d/pmset-disablesleep fi echo "✓ SleepToggle removed."