Mouse Scroll reverse (Natural) Cinnamon [SOLVED]

Questions about hardware,drivers and peripherals
Forum rules
Before you post please read how to get help
Post Reply
User avatar
Ferrari1978
Level 1
Level 1
Posts: 3
Joined: Thu Jan 18, 2018 6:22 am
Location: Brazil

Mouse Scroll reverse (Natural) Cinnamon [SOLVED]

Post by Ferrari1978 » Thu Jan 18, 2018 8:57 am

Hi, I'm having problems to use mouse scroll reverse, I'v tried some solutions posted but nothing works. Some help?
:)
Last edited by Ferrari1978 on Sat Feb 03, 2018 4:35 pm, edited 1 time in total.
Mint 18.3 Cinnamon

User avatar
Moem
Level 17
Level 17
Posts: 7988
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Mouse Scroll reverse (Natural) Cinnamon

Post by Moem » Thu Jan 18, 2018 9:31 am

If you can tell us what all you've tried, we don't have to repeat solutions that aren't going to work.
First of all, I assume you've tried the setting?
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!

User avatar
Ferrari1978
Level 1
Level 1
Posts: 3
Joined: Thu Jan 18, 2018 6:22 am
Location: Brazil

Re: Mouse Scroll reverse (Natural) Cinnamon

Post by Ferrari1978 » Fri Jan 19, 2018 11:09 am

HI, sorry for not mentioned anything, next time I'll remember that but after a workaround from forums and try some solutions that not works for me, I discovered one discussion on Google talks which solved the problem, that I described below.

FIRST open terminal and load this:

xinput list

Take the ID for your mouse from the list showed

SECOND Now type in terminal with the following command to enable it
(Attention...place your deviceID at ## )

xinput --set-int-prop ## "libinput Natural Scrolling Enabled" 8 1

Example - in my case the command will be: xinput --set-int-prop 10 "libinput Natural Scrolling Enabled" 8 1

After that your mouse should works properly, but its a temporary solution, you need to put it in startup programs to work always after reboot.

So in Menu open Startup Applications and create a new entry by clicking in ADD button and choose Custom Command, a window will open so you can put a name like "Natural scroll" and in command put again the line below:

xinput --set-int-prop ## "libinput Natural Scrolling Enabled" 8 1

Finally click add and its all done.

Work for me.
Mint 18.3 Cinnamon

laubster
Level 1
Level 1
Posts: 1
Joined: Wed Jun 20, 2018 10:35 pm

Re: Mouse Scroll reverse (Natural) Cinnamon [SOLVED]

Post by laubster » Wed Jun 20, 2018 11:14 pm

According to the xinput manpage, --set-int-prop is deprecated under Mint 19.

The following shell script (based on some 2016 code from musicin3d) works for me; it avoids not only --set-int-prop but also hardcoding the device ID.

Code: Select all

mouseid=$(xinput --list \
    | perl -n -e 's@.*Wheel Mouse.*id=([0-9]+).*@$1@ and print')
xinput --set-prop $mouseid 'libinput Natural Scrolling Enabled' 1
If you want to put it all on a single startup custom command (avoiding a separate shell script on the filesystem), try the following.

Code: Select all

mouseid=$(xinput --list | perl -n -e 's@.*Wheel Mouse.*id=([0-9]+).*@$1@ and print') && xinput --set-prop $mouseid 'libinput Natural Scrolling Enabled' 1

om_haribol
Level 1
Level 1
Posts: 1
Joined: Sun Dec 30, 2018 11:20 pm

Re: Mouse Scroll reverse (Natural) Cinnamon [SOLVED]

Post by om_haribol » Sun Dec 30, 2018 11:48 pm

Thank you very much. This basically worked for me too.

Here is an updated version; my mouse wasn't identified as a "Wheel Mouse" so that wouldn't have worked. This version just finds the first device with 'mouse' in the name, and uses that id.

Source code also available on my github repo: https://github.com/dubaaron/aaron-lib/b ... -scroll.sh

Just save this as "mouse-natural-scroll.sh" somewhere, and then add that to your autorun.

Code: Select all

#!/bin/bash

# Enable "natural scrolling" (reverse mouse wheel) in Linux

# to debug
# set -x

# get the mouseid by filtering output of xinput --list
# matches id of first device with word "mouse"
mouseid=$(xinput --list | sed -E '/mouse/I!d;s/.*?mouse.*?id=([0-9]+).*/\1/i;q')

#echo $mouseid

# set natural scrolling property to given mouseid
xinput --set-prop $mouseid 'libinput Natural Scrolling Enabled' 1

Post Reply

Return to “Hardware Support”