From 02ef2dcb85799a9db159e05d211e24b211632139 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 24 Jun 2025 22:40:28 -0400 Subject: [PATCH] host/etc/tmux.conf: only mention battery percentage on machines w/ batteries --- src/host/rootfs/etc/tmux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/host/rootfs/etc/tmux.conf b/src/host/rootfs/etc/tmux.conf index 1be1172..cab552c 100644 --- a/src/host/rootfs/etc/tmux.conf +++ b/src/host/rootfs/etc/tmux.conf @@ -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 && 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]"