实测ubuntu 14.04 好使
1) 编辑 /etc/systemd/logind.conf
2) 找到 HandleLidSwitch 设置,去掉行头注释#,然后改成下面这样
HandleLidSwitch=ignore
3) 重启systemd-logind
sudo restart systemd-logind
增加另外一种方法:
2nd Option: Run dconf-editor then go "org->gnome->settings-daemon->plugins->power". Here you should have the possibility to set various options(buttons actions,sleep,etc.). Among them you should have the'lid-close-battery-action' and'lid-close-ac-action settings'. If not move to 3 Optionotherwise adjust the settings as required.