步骤一
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=(echoDEV_SYS_PATH | /usr/bin/sed -ne 's/(^.usb[0-9]).$/\1/p')
WAKEUP_FILES=(/usr/bin/findP_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
|
|
|
|
|
版权说明:论坛帖子主题均由合作第三方提供并上传,若内容存在侵权,请进行举报