解决ubuntu使用笔记本自带电池后鼠标断电或间歇性失灵

2019-07-13 23:36发布

我的系统   ubuntu14.04
前几天玩linux一直插着电源玩的,今天突然发现拔掉电源以后鼠标间歇性失灵,或者直接断电,指示灯不亮了。
一番折腾后,用如下到办法解决了。
生命不息,折腾不止!
1.alt+ctrl+t调出终端
    输入$lsusb
看到了好多,如下 Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 004: ID 04f2:b336 Chicony Electronics Co., Ltd Bus 003 Device 007: ID 1a2c:0021 China Resource Semico Co., Ltd Keyboard Bus 003 Device 009: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 2.先把所有信息写到一个文件去方便等会查找鼠标的ID
终端输入:

lsusb -v > ./test.txt
然后用编辑器打开test.txt这个文件,搜索Mouse,看到如下到东西
us 003 Device 009: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x093a Pixart Imaging, Inc. idProduct 0x2510 Optical Mouse
好的,记下鼠标到ID。上面红 {MOD}的部分
ID 093a:2510 然后打开配置文件 sudo gedit /etc/laptop-mode/conf.d/usb-autosuspend.conf
再搜索“AUTOSUSPEND_USBID_BLACKLIST=”
搜到这些东西

# The list of USB IDs that should not use autosuspend. Use lsusb to find out the # IDs of your USB devices. # Example: AUTOSUSPEND_USBID_BLACKLIST="046d:c025 0123:abcd" AUTOSUSPEND_USBID_BLACKLIST=""
AUTOSUSPEND_USBID_BLACKLIST=""双引号输入刚刚搜索到的鼠标到ID号。
好了。保存一下。拔掉电源。鼠标已经正常工作。


END