Files
nix/hosts/common/configs/system/powertop/mouse.sh
2025-02-10 13:30:18 +00:00

14 lines
372 B
Bash

SEARCH_STRINGS=(
"Mouse"
"Razer DeathAdder V3 HyperSpeed"
)
for search_string in "${SEARCH_STRINGS[@]}"; do
echo "Searching for devices matching: $search_string"
for f in $(grep -l "$search_string" /sys/bus/usb/devices/*/product 2>/dev/null | sed "s/product/power\\/control/"); do
echo "Setting power control to 'on' for: $f"
echo on >| "$f"
done
done