I'm using dwm as my window manager and dwmblocks as my status bar. I've created a udev rule to update the battery icon when plugin and unplugging the charger:
ACTION=="change", SUBSYSTEM=="power_supply", ATTR{online}=="1", RUN+="path/to/script.sh" ACTION=="change", SUBSYSTEM=="power_supply", ATTR{online}=="0", RUN+="path/to/script.sh"
Relevant dwmblocks line:
{"", "/home/mike/scripts/statusbar/battery", 60, 13}
script.sh contains the /bin/pkill -SIGRTMIN+13 dwmblocks
signal to update the status bar.
My problem is that the status bar only updates when UNPLUGGING the charger not when plugin it for some reason. Any help?