From cd1a73f30425f09c236d10c2f2b81c4a7a453841 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Fri, 30 Aug 2019 16:55:17 +0100 Subject: [PATCH] Add battery percentage to status bar on macOS --- tmux.conf | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tmux.conf b/tmux.conf index dd9b354..357a344 100644 --- a/tmux.conf +++ b/tmux.conf @@ -120,8 +120,11 @@ setw -g status-left-style fg=colour240,bg=colour233 # Centre status style setw -g status-style fg=colour240,bg=colour233 -# Right status style -setw -g status-right "%a %d-%m-%y %H:%M " +# Right status style, show data and time (and battery percentage on macOS). +if '[ "`uname`" = "Darwin" ]' \ + 'setw -g status-right "#(pmset -g batt | grep --color=never -Eo "\\d+%%")\ + %a %d-%m-%y %H:%M "' \ + 'setw -g status-right "%a %d-%m-%y %H:%M "' setw -g status-right-style fg=white,bg=colour233 # Active window status style