An early christmas present from me to you (mostly @alexshendi)
A C program to read the SOCVF register on the max17042 in the GPD Pocket. This will give you an approximate percentage battery left.
A real driver is coming, I didn't want to leave for the holidays without passing this on.
Readings aren't very accurate and this isn't really tested, but better than a surprise shutdown.
You need to load ig4 and iic kernel modules, then run it with permission to /dev/iic0
https://github.com/adventureloop/gpdpocket/blob/master/max-fuelgauge.c