#!/bin/sh

charge=$(envstat | grep charge: | sed 's/.*(\(.*\))/\1/' | tr '\n' ' ')

if envstat | grep -Eiq 'connected.*true'; then
  status=up
else
  status=down
fi   
echo $charge $status
