Propably most pleasant way to switch your Macbook machine between clamshell mode without power adapter.
- sudo pmset -a sleep 0
- sudo pmset -a disablesleep 1
- sudo pmset -a displaysleep 5 (sleep timer set to 5 mins)

- sudo pmset -a sleep 1
- sudo pmset -a disablesleep 0
- sudo pmset -a displaysleep 1 (change if you want different sleep timer)


- Remeber to check "Run as administrator" box to run the commands with proper permissions.
- If your screen goes sleep mode, you have to open the lid to wake up machine (trying to find a solution for that)
Sleep iCloud link: https://www.icloud.com/shortcuts/e2dc776519b04decaff3c9935723b1b9
No sleep iCloud link: https://www.icloud.com/shortcuts/ebbaa6956a884cd590974aad6f7596ad