tmuxrc: add battery info

This commit is contained in:
Rob Watson 2023-05-31 06:52:57 +02:00
parent 2cb9b2d923
commit 93bcfe9f9c
2 changed files with 12 additions and 1 deletions

11
script/batinfo Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
#
# Print battery percentage to stdout
set -e
if [ $(uname -s) = "Darwin" ]; then
echo "" # TODO
else # Linux
echo "$(cat /sys/class/power_supply/BAT0/capacity)%"
fi

View File

@ -10,7 +10,7 @@ set-option -g set-titles on
set-option -g focus-events on
set -g status-style 'fg=white, bg=colour8'
set -g window-status-current-style 'fg=black, bg=green'
set -g status-right '#[fg=black, bg=colour2] #(sysinfo) #[default] #[fg=white, bg=colour238] %H:%M #[default]'
set -g status-right '#(batinfo) #[fg=black, bg=colour2] #(sysinfo) #[default] #[fg=white, bg=colour238] %H:%M #[default]'
set -g status-justify centre
set-window-option -g mode-keys vi