So while on battery power you have the option to prevent the computer from sleeping when display is off. How ever this option is only available while on power adapter. Is there a way to do this on battery power? Prevent computer from sleeping when display is of but on battery power? thank you in advance
Amphetamine is a free application that will give you a lot of power and flexibility about keeping your Mac awake under various conditions.
It has been around for a number of years and considered very trustworthy. I would recommend it without reservation.
Amphetamine even has an option to disable itself when the battery reaches a certain percentage, which will reduce the chance that you will unwittingly run the battery to 0% (it is not generally advisable to run the battery fully empty). Obviously, the final choice is up to you.