Skip to content

Commit

Permalink
disable tmux-battery when there is no battery
Browse files Browse the repository at this point in the history
acpi seems portable enough to detect this
  • Loading branch information
HarHarLinks committed Mar 22, 2018
1 parent 558d591 commit 3108a9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions maglev.tmux
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3108a9a

Please sign in to comment.