ubuntu18.04 HP笔记本合上盖子不休眠不断网

  1. 不休眠

    sudo vim /etc/systemd/logind.conf
    

    将其中的:

    #HandleLidSwitch=suspend
    

    改为:

    HandleLidSwitch=ignore
    
  2. 不断网(参考博客)
    在/etc/systemd/sytem文件夹下打开终端,创建文件hp-keycodes.service,新建一个systemd的服务:

    sudo  gedit  hp-keycodes.service
    

    文件内容为:

    [Unit]
    Description=HP setkeycodes fix
     
    [Service]
    Type=oneshot
    Restart=no
    RemainAfterExit=no
    ExecStart=/usr/bin/setkeycodes e057 240 e058 240
     
    [Install]
    WantedBy=rescue.target
    WantedBy=multi-user.target
    WantedBy=graphical.target
    

    加载服务并重启:

    sudo systemctl daemon-reload
    sudo systemctl enable hp-keycodes.service
    sudo reboot
    

你可能感兴趣的:(ubuntu18.04日常,ubuntu)