I am trying to keep my laptop running with the lid closed.

What I've done so far is: 

1. In the file `/etc/systemd/logind.conf` add `HandleLidSwitch=ignore` both for docked and plain mode. This didn't do the trick at all.
2. In the file `/etc/UPower/UPower.conf` set `IgnoreLid=true`

This worked, but now my TeamViewer session closes and the screen is locked, so I still can't actually use the laptop.