replaces ui.status.power.UPower, which may not always be present, with gi.UPowerGlib
replaces hardcoded dbus interface shemas (which may become out-of-date) with schemas provided by gnome-shell
for some reason, the Inhibit method isn't exposed in the SessionManager schema so this one is still hardcoded
waits until the battery proxy is reachable to connect to its signals
switches from batteryProxy.Type === UPower.DeviceKind.BATTERY to batteryProxy.IsPresent, enabling compatibility with other kinds of backup power (ie UPS)
inhibits on power state UPower.DeviceState.PENDING_CHARGE
batteries enter this state when the device receives power but the batteries aren't charging yet
fixes a bug that tried to remove dock inhibition even when no dock was in use, thus locking the operation queue and never unlocking
ui.status.power.UPower
, which may not always be present, withgi.UPowerGlib
Inhibit
method isn't exposed in the SessionManager schema so this one is still hardcodedbatteryProxy.Type === UPower.DeviceKind.BATTERY
tobatteryProxy.IsPresent
, enabling compatibility with other kinds of backup power (ie UPS)UPower.DeviceState.PENDING_CHARGE