步骤一
1.创建50-usb-wakeup.rules
sudo deepin-editor /etc/udev/rules.d/50-usb-wakeup.rules
内容:ACTION=="add", ENV{DEVNAME}=="/dev/input/mouse[0-9]", DRIVERS=="usb", RUN+="/opt/udevScripts/wakeup.sh %S%p"
步骤二
2.创建wakeup.sh
mkdir /opt/udevScripts
sudo deepin-editor /opt/udevScripts/wakeup.sh
添加内容:
#!/bin/bash
DEV_SYS_PATH=$1
P_USB_PATH=$(echo $DEV_SYS_PATH | /usr/bin/sed -ne 's/\(^.*usb[0-9]\).*$/\1/p')
WAKEUP_FILES=$(/usr/bin/find $P_USB_PATH -name wakeup)
for file in $WAKEUP_FILES
do
echo "enabled" > $file
logger "<$0>: set $file to \"enabled\""
done
步骤三
添加文件的执行权限
3.sudo chmod +x /opt/udevScripts/wakeup.sh
步骤四
重启服务
4.systemctl restart udev
如果您发现该资源为电子书等存在侵权的资源或对该资源描述不正确等,可点击“私信”按钮向作者进行反馈;如作者无回复可进行平台仲裁,我们会在第一时间进行处理!
添加我为好友,拉您入交流群!
请使用微信扫一扫!