host/etc/tmux.conf: only mention battery percentage on machines w/ batteries

This commit is contained in:
Ryan Heywood 2025-06-24 22:40:28 -04:00
parent 04415494ef
commit 7d4cba095e
Signed by: ryan
GPG Key ID: 8E401478A3FBEF72
1 changed files with 1 additions and 1 deletions

View File

@ -14,7 +14,7 @@ set-option -g status-left "[#S] "
set-option -g status-right ""
# The current power battery level
set-option -ag status-right " [#(cat /sys/class/power_supply/BAT0/capacity)%%]"
set-option -ag status-right '#(test -d /sys/class/power_supply/BAT0/capacity && printf " [%%s%%%%]" "$(cat /sys/class/power_supply/BAT0/capacity)")'
# Current date and time, in case it's relevant, and has drifted
set-option -ag status-right " [%Y-%m-%d %H:%M:%S]"