s*)
# set sensitivity
while read -r line; do
- xinput set-prop $line "libinput Accel Speed" "${2:--0.4}"
+ xinput set-prop "$line" "libinput Accel Speed" "${2:--0.4}"
+ done <<<"$(iconf mouse)"
+ ;;
+m*)
+ # set sensitivity but map volume from 0 to 100
+ if [ -n "$2" ]; then
+ SENSITIVITY=$(echo "( $2 / 50 ) - 1" | bc -l)
+ else
+ SENSITIVITY="-.04"
+ fi
+
+ while read -r line; do
+ xinput set-prop "$line" "libinput Accel Speed" "$SENSITIVITY"
done <<<"$(iconf mouse)"
;;
z)
if [ -e /tmp/zeromouse ]; then
rm /tmp/zeromouse
- instantmouse s "$(iconf mousespeed)"
+ while read -r line; do
+ xinput --enable "$line"
+ done <<<"$(iconf mouse)"
else
- instantmouse s -1
+ while read -r line; do
+ xinput --disable "$line"
+ done <<<"$(iconf mouse)"
touch /tmp/zeromouse
fi
if iconf -i reversemouse; then
iconf -i reversemouse 0
while read -r line; do
- xinput set-prop $line "libinput Natural Scrolling Enabled" "0"
+ xinput set-prop "$line" "libinput Natural Scrolling Enabled" "0"
done <<<"$(iconf mouse)"
echo "reverse scrolling disabled"
else
iconf -i reversemouse 1
echo "reverse scrolling enabled"
while read -r line; do
- xinput set-prop $line "libinput Natural Scrolling Enabled" "1"
+ xinput set-prop "$line" "libinput Natural Scrolling Enabled" "1"
done <<<"$(iconf mouse)"
fi
;;