diff --git a/lowbatterycron.sh b/lowbatterycron.sh index 84c7435..f341da9 100755 --- a/lowbatterycron.sh +++ b/lowbatterycron.sh @@ -1,13 +1,12 @@ #!/bin/bash -# Add the following to your crontab to get this working -# DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus -# XAUTHORITY=/home/nemo/.Xauthority BATTINFO=`acpi -b` BATTERY=/sys/class/power_supply/BAT0 REM=`grep "POWER_SUPPLY_CHARGE_NOW" $BATTERY/uevent | awk -F= '{ print $2 }'` FULL=`grep "POWER_SUPPLY_CHARGE_FULL_DESIGN" $BATTERY/uevent | awk -F= '{ print $2 }'` PERCENT=`echo $(( $REM * 100 / $FULL ))` +DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus +XAUTHORITY=/home/nemo/.Xauthority echo "Battery is at $PERCENT%"