Last active
December 21, 2016 16:39
-
-
Save whatisinternet/eb123131549c68c83a26e5b7e60d4b12 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# <bitbar.title>Battery Indicator</bitbar.title> | |
# <bitbar.version>v0.2</bitbar.version> | |
# <bitbar.author>Josh Teeter</bitbar.author> | |
# <bitbar.author.github>whatisinternet</bitbar.author.github> | |
# <bitbar.desc>Get your battery life indicator in the menu bar</bitbar.desc> | |
if $(pmset -g batt | grep -qoEi "discharging"); then | |
echo $(pmset -g batt | grep -oEi "(\d{0,}:\d{0,} remaining)") | |
else | |
echo ":zap:" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment