#!/bin/sh swaymsg -q >/dev/null 2>&1 SWAY=$? if [ $SWAY -ne 0 ] ; then ID=$(xinput --list --id-only "PS/2 Synaptics TouchPad") ENABLED=$(xinput list-props $ID | grep -E "Evdev Wheel Emulation \([0-9]*\):" | awk '{print $5}') if [ $ENABLED = 1 ] ; then xinput set-prop $ID --type=int --format=8 "Evdev Wheel Emulation" 0 echo "disabled" else xinput set-prop $ID --type=int --format=8 "Evdev Wheel Emulation" 1 echo "enabled" fi else status=$(swaymsg -rt get_inputs | jq -r '.[] | select(.identifier == "2:10:TPPS/2_IBM_TrackPoint") | .libinput.scroll_method') if [ "$status" = 'on_button_down' ] ; then swaymsg input "2:10:TPPS/2_IBM_TrackPoint" scroll_method none echo "disabled" else swaymsg input "2:10:TPPS/2_IBM_TrackPoint" scroll_method on_button_down echo "enabled" fi fi