-
-
Save Clivern/3f6d6b93847ecff802ce23e9256b106d to your computer and use it in GitHub Desktop.
Launcher script for Slack on macOS which warns you if you open if while on battery power
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [[ $(pmset -g ps | head -1) =~ "Battery Power" ]]; then | |
osascript -e 'display notification "You are starting Slack while running on battery power" with title "Battery Drain Source Detected" subtitle ""' | |
fi | |
open /Applications/Slack.app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment