Ubuntu 22.04自动挂起后无法唤醒

可实现在键盘、鼠标断电后的唤醒

2023.7.17ps:最好别合上笔记本屏幕

但是为了以防万一,建议在设置中将挂起有关选项全部关闭

 一、安装(这个不知道干嘛的)

sudo apt-get install pm-utils

二、检测是否安装了laptop-mode-tools

dpkg -l|grep laptop-mode-tools

若没有输出,则进行第三步;若有输出,则跳过

三、安装

sudo apt-get install laptop-mode-tools

以下代码检验是否安装成功

dpkg -l|grep laptop-mode-tools

出现 

ii  laptop-mode-tools                                 1.74-1.1                                all          Tools for Power Savings based on battery/AC status

四、判断并修改

1. 判断Laptop是否启用了laptop_mode,如果显示结果为0,则表示未启动,如果为非0的数字则表示启动了

cat /proc/sys/vm/laptop_mode

2. 启动laptop_mode并可查看结果

sudo laptop_mode start

 3. 修改配置文件,解决鼠标键盘自动休眠导致的失灵问题

sudo gedit /etc/laptop-mode/conf.d/runtime-pm.conf

为了解决鼠标键盘自动休眠导致的失灵问题,需要执行命令:sudo gedit /etc/laptop-mode/conf.d/runtime-pm.conf

把AUTOSUSPEND_RUNTIME_DEVID_BLACKLIST=""

改为AUTOSUSPEND_DEVID_BLACKLIST="usbhid usb-storage"
————————————————
版权声明:本文为CSDN博主「zaf赵」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/zaf0516/article/details/103105916

4. 配置laptop_mode

sudo gedit /etc/laptop-mode/laptop-mode.conf

第83-100行:将以下置1

#
# Enable laptop mode power saving, when on battery power.
#
ENABLE_LAPTOP_MODE_ON_BATTERY=1


#
# Enable laptop mode power savings, even when on AC power.
# This is useful when running as a headless machine, in low power mode
#
ENABLE_LAPTOP_MODE_ON_AC=1


#
# Enable laptop mode when the laptop's lid is closed, even when we're on AC
# power? (ACPI-ONLY)
#
ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED=1

另:其他教程中有附带项,输入sudo gedit /etc/default/acpi-support用于更改ENABLE_LAPTOP_MODE=true,但在实际查找过程中并未找到,而是在末尾找到了

# Note: to enable "laptop mode" (to spin down your hard drive for longer
# periods of time), install the laptop-mode-tools package and configure
# it in /etc/laptop-mode/laptop-mode.conf. 

故直接跳过此步骤进入4. 配置laptop_mode

你可能感兴趣的:(ubuntu,linux)