[work complete]Daily Ubuntu Tips – Do Nothing When Laptop Lid Is Closed

This commit is contained in:
bazz2 2013-12-31 17:05:47 +08:00
parent 37447dc55e
commit d162e5a090
2 changed files with 45 additions and 46 deletions

View File

@ -1,46 +0,0 @@
[bazz2 再来一篇,翻完吃饭]
Daily Ubuntu Tips Do Nothing When Laptop Lid Is Closed
================================================================================
Ubuntu, a powerful and modern operation system is being used by millions of individual users and businesses around the world. From basic workstation to advanced engineering machines, Ubuntu is powering them all.
If youre just started out with Ubuntu and need help working with it, keeping coming to this blog for help. Weve written hundreds of posts on Ubuntu that will get you started.
From learning how install Ubuntu to configuring basic settings, weve have covered all.
This brief tutorial is going to show you how to configure Ubuntu on a laptop computer so that when the lid is closed, it doesnt put the computer to sleep or shut it down.
Most modern operating systems, including Windows is designed to put the laptop to sleep when the lid is closed. Ubuntu also does this. If you only want to close the lid and not put your laptop to sleep, continue below to learn how to do it in Ubuntu.
There are two ways to go about making this work in Ubuntu. One way is to open **System Settings > Power** and setting the options there. Some users have had issues where doing it from System Settings didnt work.
Another option is go change the settings from the configuration file of the Login Manager (**logind.conf**). Using this method has worked for many and you should try it as well.
To get started, press **Ctrl Alt T** on your keyboard to open the terminal. When it opens, run the commands below to open logind.conf file. There this file is where youll make this change.
sudo gedit /etc/systemd/logind.conf
When the file opens, modify or change line line from this:
#HandleLidSwitch=suspend
To this:
HandleLidSwitch=ignore
And save the file. After saving the file, run the commands below to reset the Login Manager.
sudo restart systemd-logind
Thats it!
The ignore value tell Ubuntu not to sleep or hibernate when the laptop lid is closed. Leave the rest of the line intact and save the file.
![](http://www.liberiangeek.net/wp-content/uploads/2013/12/photo.jpg)
--------------------------------------------------------------------------------
via: http://www.liberiangeek.net/2013/12/daily-ubuntu-tips-do-nothing-when-laptop-lid-is-closed/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,45 @@
Ubuntu 一天一课 合上笔记本,系统不睡眠
================================================================================
Ubuntu 是一个处在牛 A 和牛 C 之间的现在操作系统,全世界数百万人和公司都在使用它。无论是充当工作台还是高级工程机器(译者表示不知道 advanced engineering machines 是个什么东西Ubuntu 都游刃有余。
如果你是 Ubuntu 初学者,使用过程还需要高手指导,那就关注本博客吧。我们已经写了数百 Ubuntu 教程,足以带你入门。
从安装 Ubuntu 到系统基本设置,我们都有涉猎。
这篇简单的教程为你介绍当笔记本盖子合上时该干嘛还是干嘛,而不是进入睡眠模式或者直接关机。
很多现在操作系统(包括 Windows会在笔记本合上时进入睡眠状态。Ubuntu 也是这样做的。如果你想让你的笔记本盖子合上时不睡眠,就跟着我们学习吧。
要达到这个目的Ubuntu 有两种方法。第一种是打开 **System Settings > Power**(中文版是打开 **系统设置 -> 电源**),然后进行设置。一些用户设置后不会生效。
另一个方法是直接编辑 Login Manager 的配置文件(**logind.conf**)。这个方法基本能生效,你最好用这个。
要开始了,按下 **Ctrl Alt T** 组合键,打开终端。然后运行下面的命令打开 logind.conf 文件。你的所有修改都在这个文件内。
sudo gedit /etc/systemd/logind.conf
打开文件后修改下面这行:
#HandleLidSwitch=suspend
改成这副德行:
HandleLidSwitch=ignore
保存文件,重启 Login Manager 服务:
sudo restart systemd-logind
工作完成!
配置文件的 “ignore” 值告诉 Ubuntu 当笔记本合上后不要睡眠或挂起。不要动其它设置然后保存文件。
![](http://www.liberiangeek.net/wp-content/uploads/2013/12/photo.jpg)
--------------------------------------------------------------------------------
via: http://www.liberiangeek.net/2013/12/daily-ubuntu-tips-do-nothing-when-laptop-lid-is-closed/
译者:[bazz2](https://github.com/bazz2) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出