I am looking for a way to hibernate (i.e. RAM saved to HDD then turned off) only when closing the lid. When the lid is opened, I expect OSX to simply turn off the screen after X minutes (i.e. everything keeps running). Mostly what a Windows PC does out of the box.
pmset does not seem to make possible controlling what happens when closing the lid.