Interesting, when fixing the script I relied on the mode the USB ports are in (which they should always be in source mode for a desktop machine but apparently each vendor does things differently).
The USB port being in sink mode means that it is configured to power the system and not power peripherals. It seems that systemd devs were aware of this behavior in some machines and added an extra check that verifies battery status. Currently on_ac_power has no such checks and completely ignores batteries. I will update the script to also check for batteries and battery status before returning that the system is in offline mode. Thanks! -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1980991 Title: /usr/sbin/on_ac_power incorrectly reporting ac power status To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/powermgmt-base/+bug/1980991/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
