-
-
Save stephencelis/4324139 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
#!/usr/bin/env sh | |
# | |
# Works best with blinking text: the last heart will blink when you have less | |
# than 25% of your battery life remaining. | |
# | |
# Add the following to your `~/.tmux.conf`; | |
# | |
# set -g status-right "#[fg=red]#(path/to/zelda-battery-tmux.sh) " | |
battery="$(pmset -g ps | awk 'NR==2' | perl -pe 's/.*?(\d+)%.*/\1/')" | |
if [[ $battery -lt 25 ]]; then | |
echo "#[blink]♥#[noblink]♡♡" | |
elif [[ $battery -lt 50 ]]; then | |
echo "♥♡♡" | |
elif [[ $battery -lt 75 ]]; then | |
echo "♥♥♡" | |
else | |
echo "♥♥♥" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment