Script to enable/disable horizontal scroll on Ubuntu

Asked

Viewed 124 times

0

Some programs do not work well with horizontal scroll on Ubuntu, such as Netbeans and Astah (Question on topic).

An alternative is to enable/disable horizontal scroll via a script.

1 answer

1

The alternative I found for horizontal scroll not to disturb while using these programs is a script to enable/disable.

Create the file /usr/local/bin/hs_disable

DEVICE_NAME='ETPS/2 Elantech Touchpad'
PROP_NAME='Synaptics Two-Finger Scrolling'

xinput set-int-prop "$DEVICE_NAME" "$PROP_NAME" 8 1 0
if [[ $? -eq 0 ]] ; then
  notify-send "Script" "Horizontal Scrolling Disabled" -i /usr/share/pixmaps/touchpad_disabled.png -t 5000
else
  notify-send "Script" "Error disabling horizontal scroll." -i /usr/share/pixmaps/Cancel-icon.png -t 5000
fi

Create the file /usr/local/bin/hs_enable

DEVICE_NAME='ETPS/2 Elantech Touchpad'
PROP_NAME='Synaptics Two-Finger Scrolling'

xinput set-int-prop "$DEVICE_NAME" "$PROP_NAME" 8 1 1
if [[ $? -eq 0 ]] ; then
  notify-send "Script" "Horizontal Scrolling Enabled" -i /usr/share/pixmaps/touchpad.png -t 5000
else
  notify-send "Script" "Error enabling horizontal scroll." -i /usr/share/pixmaps/Cancel-icon.png -t 5000
fi

Execute chmod +x in both files to allow execution

Browser other questions tagged

You are not signed in. Login or sign up in order to post.