Created
September 2, 2014 05:06
-
-
Save pop/92f4ae38c2a05812d873 to your computer and use it in GitHub Desktop.
A simple way to display the time remaining for your laptop battery in your tmux prompt
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/sh | |
### ~/bin/battery_time_remaining.sh | |
### Elijah Caine | pop_n_fresh @ irc.freenode.net | |
### Displays the time remaining on your battery | |
### Requires acpi - Displays nothing without it | |
## '{print $5} can be changed to '{print $4}' for a percentage | |
BAT_TIME=$(acpi | awk '{print $5}') | |
echo $BAT_TIME |
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
set status-interval 15 | |
set -g status-right "Bat [ #(~/bin/battery_time_remaining.sh) ] ~ [ #[fg=black]%H:%M ]" | |
set -g status-left "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment