How to add natural (/inverted) mouse-scrolling in i3 window manager?
Edit /usr/share/X11/xorg.conf.d/40-libinput.conf
Add there Option "NaturalScrolling" "True"
like this:
For your mouse:
# Match on all types of devices but joysticks
Section "InputClass"
Identifier "libinput pointer catchall"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
Option "NaturalScrolling" "True"
EndSection
For your touchpad:
Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
Option "NaturalScrolling" "True"
EndSection
Then log off and on to apply.
Related videos on Youtube
tbrodbeck
Updated on September 18, 2022Comments
-
tbrodbeck over 1 year
As you can maybe see, this is my first post. So, I have already been trying and researching a lot, but I still can't solve this problem.
I really enjoy natural scrolling, but not only on my touchpad, but also on my mouse - but this did not work so far. My current setup is Ubuntu 18.04.2 on a late 2012 (first hidpi) MacBook with i3 wm and I use a performance MX logitech mouse. This is a pretty new setup I installed yesterday.
I did invert my touchpad scrolling with synaptics and tried to modify my mouse keys with xmodkeys, but it did not work.
xmodmap -e 'pointer = 1 2 3 5 4 6 7 8 9 10 11 12'
The strange this is, that my mouse buttons are actually inverted (4 and 5) when I test it with xev, but this does not affect the scrolling behaviour. I could also remap other mouse keys, but the scrolling seems not changeable.
xinput ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Logitech Performance MX id=10 [slave pointer (2)] ⎜ ↳ bcm5974 id=13 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Power Button id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Power Button id=8 [slave keyboard (3)] ↳ Sleep Button id=9 [slave keyboard (3)] ↳ FaceTime HD Camera (Built-in): id=11 [slave keyboard (3)] ↳ Apple Inc. Apple Internal Keyboard / Trackpad id=12 [slave keyboard (3)] xinput list-props 10 Device 'Logitech Performance MX': Device Enabled (143): 1 Coordinate Transformation Matrix (145): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 libinput Natural Scrolling Enabled (278): 0 libinput Natural Scrolling Enabled Default (279): 0 libinput Scroll Methods Available (280): 0, 0, 1 libinput Scroll Method Enabled (281): 0, 0, 0 libinput Scroll Method Enabled Default (282): 0, 0, 0 libinput Button Scrolling Button (283): 2 libinput Button Scrolling Button Default (284): 2 libinput Middle Emulation Enabled (285): 0 libinput Middle Emulation Enabled Default (286): 0 libinput Accel Speed (287): 0.000000 libinput Accel Speed Default (288): 0.000000 libinput Accel Profiles Available (289): 1, 1 libinput Accel Profile Enabled (290): 1, 0 libinput Accel Profile Enabled Default (291): 1, 0 libinput Left Handed Enabled (292): 0 libinput Left Handed Enabled Default (293): 0 libinput Send Events Modes Available (263): 1, 0 libinput Send Events Mode Enabled (264): 0, 0 libinput Send Events Mode Enabled Default (265): 0, 0 Device Node (266): "/dev/input/event5" Device Product ID (267): 1133, 4122 libinput Drag Lock Buttons (294): <no items> libinput Horizontal Scroll Enabled (295): 1
I hope for any support, since I really want to have my natural scrolling back :> Peace!
-
tbrodbeck about 5 yearsI did add that to
/usr/share/X11/xorg.conf.d/40-libinput.conf
and I didsudo apt remove xserver-xorg-input-synaptics
. And I did log off. So far it is still exactly the same as befor (touchpad inverted but not mouse) -
Pilot6 about 5 yearsDid you add to both sections? I've edited my post.
-
Pilot6 about 5 yearsDoes
xinput set-prop 13 278 1
fix it immediately? -
tbrodbeck about 5 yearsAHHH :) Feels like I am back home. Thanks a lot! (now I included both sections)
-
tbrodbeck about 5 yearsBtw: I switched back to synaptic because I like the feel of the scrolling better, but the section for the mouse is still working
-
Pilot6 about 5 yearsYup, in synaptics you have scrolling has inertia, but libinput has better palm protection. You can do it in synaptics as well though.