I don’t know whether it works but I just run a cron
job every X minutes. Said job calculates the battery level and if below a threshold and not charging then it talks to me. Obviously said shell script is limited only by your imagination.
You can find an example script e.g. here: Script to Play a Battery Charge Notification or Warning - #20 by amarok and surrounding discussion.