The following tutorial will let you know how to log out after a period of inactivity on your Macbook. By default, this feature is turned off, which means no matter how long your Mac is inactive, it will not go to sleep. If you want to save some battery and let your Macbook take some rest while you are not using, then this feature is definitely worth a try.
Steps To Log Out After A Set Period Of Inactivity on Mac OS X
1. Open the System Preferences.
2. Go to the Security & Privacy.
3. If you find a padlock icon at the bottom left, it means advanced setting is locked. Click on it.
4. You will be prompted to enter the administrator password. Now the advanced setting will be unlocked.
5. The Advanced option, which was initially greyed out will now become available.
6. Now check the option “Log out after” and select the time period of inactivity after after which your Mac will shut down.