sbib improve and rg bool

This commit is contained in:
ackman678
2023-05-15 10:49:24 -04:00
parent 26d1974906
commit d328524cd9
14 changed files with 171 additions and 52 deletions

View File

@@ -11,9 +11,15 @@ REM=`grep -i "charge_now" $BATTERY/uevent | awk -F= '{ print $2 }'`
FULL=`grep -i "charge_full_design" $BATTERY/uevent | awk -F= '{ print $2 }'`
PERCENT=`echo $(( $REM * 100 / $FULL ))`
if [ $PERCENT -le "11" ]; then
echo 'battery % is '$PERCENT
if [ $PERCENT -le "23" ]; then
#/usr/bin/i3-nagbar -m "Low battery"
#echo 'low battery '$PERCENT
notify-send --urgency=critical "Low battery $PERCENT%"
fi
if [ $PERCENT -le "7" ]; then
echo "powering down..."
systemctl suspend
fi