From ec9d622aa12fcabf7de3feca004532d1b1e574c1 Mon Sep 17 00:00:00 2001 From: joeyagreco Date: Sun, 18 Aug 2024 20:32:46 -0400 Subject: [PATCH] tmux show battery --- .tmux.conf | 8 ++++---- scripts/bash/battery.sh | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100755 scripts/bash/battery.sh diff --git a/.tmux.conf b/.tmux.conf index 6aff6cd..5836d52 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -13,6 +13,9 @@ set -g @light-black "#242424" # GENERAL # ########### +# refresh status bar every n seconds +set -g status-interval 15 + # Start windows and panes at 1, not 0 # you can't 1 index sessions. why? that's a great question. # https://unix.stackexchange.com/questions/313577/how-to-make-tmux-sessions-count-from-1-instead-of-0 @@ -36,9 +39,6 @@ set-option -g escape-time 10 # detect focus in a pane set -g focus-events on -# true color support. determined by checking value of $TERM -#set-option -a terminal-features ',xterm-256color:RGB' - # set ctrl+x to prefix unbind-key C-b set-option -g prefix C-x @@ -61,7 +61,7 @@ set -g history-limit 10000 # STATUS BAR set -g status-style "bg=#{@purple},fg=#{@teal}" # e.g. 'Monday May 27 4:34 PM' -set -g status-right "%A %B %-e %-I:%M %p " +set -g status-right "#(~/scripts/bash/battery.sh) | %A %B %-e %-I:%M %p " # Show session name and window number on the bottom left set -g status-left-length 40 diff --git a/scripts/bash/battery.sh b/scripts/bash/battery.sh new file mode 100755 index 0000000..807fd3f --- /dev/null +++ b/scripts/bash/battery.sh @@ -0,0 +1 @@ +pmset -g batt | grep -Eo "\d+%" | head -1