Ubuntu keeps running when laptop lid is closed

Keep running after closed lid

$ sudo vi /etc/systemd/logind.conf

...

HandleLidSwitch=ignore

...

$ sudo service systemd-logind restart

The values of HandleLidSwitch are ignore, suspend, hibernate, and poweroff.

Keep console screen always on:

$ sudo vi /etc/default/grub

...

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash consoleblank=0"

...

$ sudo update-grub

$ sudo shutdown -r now

Turn off console screen after 1 minute:

$ sudo vi /etc/default/grub

...

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash consoleblank=60"

...

$ sudo update-grub

$ sudo shutdown -r now

Written on December 10, 2016