From 3108a9a26de9463d428b8f25ad3ca2ac67e06c27 Mon Sep 17 00:00:00 2001 From: HarHarLinks Date: Thu, 22 Mar 2018 05:18:13 +0100 Subject: [PATCH] disable tmux-battery when there is no battery acpi seems portable enough to detect this --- maglev.tmux | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maglev.tmux b/maglev.tmux index 0c01b90..c405a99 100755 --- a/maglev.tmux +++ b/maglev.tmux @@ -3,13 +3,13 @@ set -e PLUGINS=$(tmux show-options -g | grep @tpm_plugins) -# Determine whether the tmux-cpu plugin should be installed +# Determine what plugins we can use SHOW_CPU=false if [[ $PLUGINS == *"tmux-cpu"* ]]; then SHOW_CPU=true fi SHOW_BATTERY=false -if [[ $PLUGINS == *"tmux-battery"* ]]; then +if [[ $PLUGINS == *"tmux-battery"* ]] && [[ $(acpi -b 2> /dev/null) == *"attery"* ]]; then SHOW_BATTERY=true fi SHOW_NET=false