File tree Expand file tree Collapse file tree 4 files changed +55
-0
lines changed
Expand file tree Collapse file tree 4 files changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ Package: uhk-usb-rebind
2+ Version: 1.0
3+ Section: utils
4+ Priority: optional
5+ Architecture: all
6+ Maintainer: Benedek Kupper <
[email protected] >
7+ Description: Rebinds UHK USB devices on resume to fix scrolling issues
8+ This package provides a script and a systemd service that put both the host and the device
9+ into a known good state after resuming from suspend. This is a temporary workaround,
10+ until this patch is merged into the Linux kernel:
11+ https://lore.kernel.org/linux-input/
[email protected] /T/#u
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ systemctl enable uhk-usb-rebind.service
Original file line number Diff line number Diff line change 1+ [Unit]
2+ Description =UHK USB reset after resume
3+ After =suspend.target
4+
5+ [Service]
6+ Type =oneshot
7+ ExecStart =/usr/local/bin/uhk-usb-rebind.sh
8+
9+ [Install]
10+ WantedBy =suspend.target
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ declare -a uhk_devices=(
4+ " 37a8:0001"
5+ " 37a8:0003"
6+ " 37a8:0005"
7+ " 37a8:0007"
8+ " 37a8:0009"
9+ )
10+
11+ USB_DRIVER_PATH=" /sys/bus/usb/drivers/usb"
12+
13+ for dev in /sys/bus/usb/devices/* ; do
14+ if [[ -f " $dev /idVendor" && -f " $dev /idProduct" ]]; then
15+ VID=$( cat " $dev /idVendor" )
16+ PID=$( cat " $dev /idProduct" )
17+ MATCH=" ${VID} :${PID} "
18+
19+ for target in " ${uhk_devices[@]} " ; do
20+ if [[ " $MATCH " == " $target " ]]; then
21+ DEVNAME=$( basename " $dev " )
22+
23+ if [[ -e " $USB_DRIVER_PATH /unbind" ]]; then
24+ echo " $DEVNAME " | sudo tee " $USB_DRIVER_PATH /unbind"
25+ sleep 1.5
26+ echo " $DEVNAME " | sudo tee " $USB_DRIVER_PATH /bind"
27+ echo " Rebound device: $dev "
28+ fi
29+ fi
30+ done
31+ fi
32+ done
You can’t perform that action at this time.
0 commit comments