Created
July 16, 2019 08:42
-
-
Save viktorklang/1a07edc5c13c20bf69f94513fe53e94b 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