Lubuntu 14.04:如何避免在关闭笔记本电脑盖时锁定屏幕?

gca*_*ali 4 xfce lubuntu laptop lid lock-screen

几天前我将我的操作系统从 Lubuntu 13.10 升级到 Lubuntu 14.04,现在当盖子合上时我的屏幕会锁定,而当盖子合上时我不想发生任何事情。

我已经在 Xfce 电源管理器中设置了正确的选项(“当笔记本电脑盖子关闭时:没有”),并且,截至https://bugs.launchpad.net/ubuntu/+source/xfce4-power-manager/+bug /1307545关闭笔记本电脑盖暂停 Lubuntu,自升级以来,我尝试编辑/etc/systemd/logind.conf;但是当我合上盖子时,屏幕仍然锁定并要求输入密码。请注意,每次关闭屏幕时都不会发生这种情况;有时它会保持关闭几分钟,并且可以在没有锁定的情况下重新打开,有时我一合上盖子它就会锁定。

作为参考,这是我的内容/etc/systemd/logind.conf

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# See logind.conf(5) for details

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#Controllers=
#ResetControllers=cpu
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
HandleLidSwitch=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
LidSwitchIgnoreInhibited=no
#IdleAction=ignore
#IdleActionSec=30min
Run Code Online (Sandbox Code Playgroud)

我的做法有问题吗?我该怎么做才能在不发生任何事情的情况下合上盖子?

编辑:可能的指示是关于当我合上盖子时到底发生了什么;我试着朝那个方向调查,但我不知道从哪里开始。如果在关闭盖子时调用脚本或其他东西,我什至可能会满足于将其修改为什么都不做。

小智 6

您在正确的轨道上使用logind.conf,但您只需要更改默认配置中的这一行:

HandleLidSwitch=ignore
Run Code Online (Sandbox Code Playgroud)

(即你不需要LidSwitchIgnoreInhibited=no)。

此外,您需要配置xfce4-power-manager处理盖子开关。我发现可靠的方法是在配置它之前从电源管理器图标菜单中退出它

$ xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/logind-handle-lid-switch -s true
Run Code Online (Sandbox Code Playgroud)

然后您需要重新启动(除非有另一种方法来获取logind其配置,在这种情况下,我很想听听它!)。

此后,盖子开关应根据电源管理器中的设置进行操作。

由于对#xubuntu 中一位乐于助人的人链接的错误的评论,我找到了这个解决方案。

请注意,这会在 suspend 时打破屏幕锁定