Something as simple as this would work:
via “upower -d” one can get the general power status including information about ac/battery. In case we are on battery revert all pins and don’t assign pcores. Could be added as config variable to be more generic.
