Skip to content

Instantly share code, notes, and snippets.

@dstokes
Created September 6, 2012 05:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dstokes/3651554 to your computer and use it in GitHub Desktop.
Save dstokes/3651554 to your computer and use it in GitHub Desktop.
Tmux Battery Indicator

Battery indicator for the tmux status line (add to ~/.tmux.conf)

Displays the charge percentage and a unicode lightning bolt when the battery is charging. Makes use of the pmset command for battery information.

Tested on MacOSX Mountain Lion

set -g status-right "batt: #(pmset -g batt | awk 'NR==2 {gsub(/;/,\"\"\\); \
  print (match($3,/^ch/\\) ? \"\⚡ \":\"\"\\) $2}') | %h-%d %H:%M "

Battery Indicator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment