zoukankan      html  css  js  c++  java
  • Linux-关闭笔记本盖不休眠

    编辑下列文件:/etc/systemd/logind.conf

    #HandlePowerKey按下电源键后的行为,默认power off

    #HandleSleepKey 按下挂起键后的行为,默认suspend

    #HandleHibernateKey按下休眠键后的行为,默认hibernate

    #HandleLidSwitch合上笔记本盖后的行为,默认suspend(改为lock;即合盖不休眠)在原文件中,还要去掉前面的#

    运行:systemctl restart systemd-logind 就会生效。

    --------------------------------------------------------------------------------------------------

    附上运行演示:

    [root@ikensee]# vim /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.

    # Entries in this file show the compile time defaults.

    # You can change settings by editing this file.

    # Defaults can be restored by simply deleting this file.

    # See logind.conf(5) for details.

    [Login]

    #NAutoVTs=6

    #ReserveVT=6

    #KillUserProcesses=no

    #KillOnlyUsers=

    #KillExcludeUsers=root

    #InhibitDelayMaxSec=5

    #HandlePowerKey=poweroff

    #HandleSuspendKey=suspend

    #HandleHibernateKey=hibernate

    HandleLidSwitch=lock (在这里把#号去掉,然后把默认suspend改成lock)

    #HandleLidSwitchDocked=ignore

    #PowerKeyIgnoreInhibited=no

    #SuspendKeyIgnoreInhibited=no

    #HibernateKeyIgnoreInhibited=no

    #LidSwitchIgnoreInhibited=yes

    #IdleAction=ignore

    #IdleActionSec=30min

    #RuntimeDirectorySize=10%

    #RemoveIPC=no

    #UserTasksMax

    [root@ikensee]# systemctl restart systemd-logind (运行重启生效)

  • 相关阅读:
    Web开发框架 SSH 简介
    H5 性能调优 工具
    Mongodb性能调优
    峰Redis学习(4)Redis 数据结构(List的操作)
    峰Redis学习(3)Redis 数据结构(字符串、哈希)
    峰Redis学习(2)Jedis 入门实例
    峰Redis学习(1)Redis简介和安装
    使用jquery.mCustomScrollbar自定义滚动条(2)
    使用jquery.mCustomScrollbar自定义滚动条(1)
    jquery zTree异步搜索的例子--搜全部节点
  • 原文地址:https://www.cnblogs.com/ikensee/p/9746940.html
Copyright © 2011-2022 走看看