2026-11-07 17:03:12 +02:00
|
|
|
# Bananarchy battery/charger statusbar hook (U4).
|
2026-11-10 13:00:41 +02:00
|
|
|
# Only the PM8916 supplies exist on these devices; filtering avoids spawning a
|
|
|
|
|
# shell for unrelated power_supply change events.
|
2026-11-07 17:03:12 +02:00
|
|
|
SUBSYSTEM=="power_supply", ACTION=="change", KERNEL=="pm8916-bms-vm", RUN+="/bin/sh -c 'DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/10000 /usr/share/sxmo/default_hooks/sxmo_hook_battery.sh udev >/dev/null 2>&1 &'"
|
2026-11-10 13:00:41 +02:00
|
|
|
# A VBUS plug/unplug changes the charger's online attribute, not necessarily
|
|
|
|
|
# the reported capacity. Force the charge icon immediately and re-read sysfs
|
|
|
|
|
# after the short race window so the icon actually changes at that moment.
|
|
|
|
|
SUBSYSTEM=="power_supply", ACTION=="change", KERNEL=="pm8916-lbc-chgr", RUN+="/bin/sh -c 'DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/10000 /usr/bin/bananarchy-battery-charge-event.sh >/dev/null 2>&1 &'"
|
|
|
|
|
# Some PM8916 firmware revisions publish the VBUS transition on a separate
|
|
|
|
|
# USB/Mains supply instead of the charger node.
|
|
|
|
|
SUBSYSTEM=="power_supply", ACTION=="change", ENV{POWER_SUPPLY_ONLINE}=="0|1", KERNEL!="pm8916-bms-vm", RUN+="/bin/sh -c 'DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/10000 /usr/bin/bananarchy-battery-charge-event.sh >/dev/null 2>&1 &'"
|