pentest-distro-builder/filesystem/root/.tmux/plugins/tmux-battery/scripts/battery_graph.sh
Kaj Forney 4fdc60b6a2 Add autologin and custom tmux config.
Former-commit-id: 9f5a64d372
Former-commit-id: 89d8a1302bd2a72239fbe9ad9820be4ecda76cab
2018-09-27 17:40:01 -06:00

28 lines
467 B
Bash
Executable file

#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CURRENT_DIR/helpers.sh"
print_graph() {
if [ -z "$1" ]; then
echo ""
elif [ "$1" -lt "20" ]; then
echo "▁"
elif [ "$1" -lt "40" ]; then
echo "▂"
elif [ "$1" -lt "60" ]; then
echo "▃"
elif [ "$1" -lt "80" ]; then
echo "▅"
else
echo "▇"
fi
}
main() {
local percentage=$($CURRENT_DIR/battery_percentage.sh)
print_graph ${percentage%?}
}
main