Skip to content
6 changes: 5 additions & 1 deletion usr/lib/linuxmint/mintUpdate/automatic_upgrades.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@
power_supply_file = open(power_connectfile)
powersupply = power_supply_file.read()[0]=='1'
power_supply_file.close()
if !powersupply:
Comment thread
Codekloeppler marked this conversation as resolved.
Outdated
battery_capacity_file = open('/sys/class/power-supply/BAT0/capacity')
Comment thread
Codekloeppler marked this conversation as resolved.
Outdated
battery_capacity = int(battery_capacity_file.read())
battery_capacity_file.close()
except:
powersupply = True
log.write(power_connectfile+" not found. Ignore power supply check.")
if powersupply:
if powersupply or battery_capacity >= 75:
try:
# Put shutdown and reboot blocker into place
os.symlink(pkla_source, pkla_target)
Expand Down