Mouse Scroll reverse (Natural) Cinnamon [SOLVED]

Questions about hardware, drivers and peripherals
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Ferrari1978

Mouse Scroll reverse (Natural) Cinnamon [SOLVED]

Post by Ferrari1978 »

Hi, I'm having problems to use mouse scroll reverse, I'v tried some solutions posted but nothing works. Some help?
:)
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Moem
Level 22
Level 22
Posts: 16233
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Mouse Scroll reverse (Natural) Cinnamon

Post by Moem »

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!
Ferrari1978

Re: Mouse Scroll reverse (Natural) Cinnamon

Post by Ferrari1978 »

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.
laubster

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

Post by laubster »

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

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

Post by om_haribol »

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
wickedmonkey

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

Post by wickedmonkey »

om_haribol wrote: Sun Dec 30, 2018 11:48 pm.
Thank you so much for this. This issue was driving me mad and your solution works for me nicely.

I am really puzzled though as to why on earth natural scrolling is included in settings panel for touchpad but not for mouse...
Last edited by karlchen on Fri May 17, 2019 10:58 am, edited 1 time in total.
Reason: shortened unneeded full quote of the post right above to the bare minimum
Locked

Return to “Hardware Support”