Score:2

natural scrolling on Unity desktop 20.04

ph flag

image

I just installed Unity coming from Gnome and I don't see natural scrolling option there. What do I need to install on Ubuntu 20.04 LTS?

mchid avatar
bo flag
Have you tried opening the gnome settings manager from the Unity desktop? Often times, you can use either/or on Unity.
mLstudent33 avatar
ph flag
@mchid I never would have thought to look but it was there. However, even when I try different combinations of natural scrolling under Mouse and Touchpad, I don't get natural scrolling.
Someone avatar
my flag
To go back to the gnome, simply run: `sudo apt install ubuntu-desktop` If you want all the applications also, then run `sudo apt install ubuntu-desktop^`
mchid avatar
bo flag
I found an answer to your original question. Feel free to revert my edits to your question but it really would be better to ask a new question if you still feel you want to switch back to Gnome. Answer is below.
mchid avatar
bo flag
However, on the login screen, you must select the Gnome or Ubuntu desktop from the list or from the gear icon menu. You should have a choice between Unity, Ubuntu Desktop, and/or Gnome et al.
mLstudent33 avatar
ph flag
@mchid, thanks for both answers. This comment made me notice the gear icon in the bottom right which I clicked and saw Gnome, Gnome on Xorg, Ubuntu, Ubuntu Wayland, Unity.
Score:2
bo flag

Okay, I found the solution that works on 18.04 which also has the same problem. Dconf and gnome settings have no effect.


First, run the following command to list your devices:

xinput list

You should see something similar to this example:

⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Lite-On Technology Corp. USB Keyboard Consumer Control    id=13   [slave  pointer  (2)]
⎜   ↳ Logitech Wireless Mouse                   id=10   [slave  pointer  (2)]

As we can see, the device is Logitech Wireless Mouse and the device is listed as id=10.


Next, run the following command to list the available parameters:

xinput list-props 10

We use 10 here because the device id=10.

Here is an example of the output:

Device 'Logitech Wireless Mouse':
    Device Enabled (131):   1
    Coordinate Transformation Matrix (133): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    libinput Natural Scrolling Enabled (266):   0
    libinput Natural Scrolling Enabled Default (267):   0
    libinput Scroll Methods Available (268):    0, 0, 1
    libinput Scroll Method Enabled (269):   0, 0, 0
    libinput Scroll Method Enabled Default (270):   0, 0, 0
    libinput Button Scrolling Button (271): 2

As we can see, Natural Scrolling is listed as parameter 266 and the value is currently 0 (zero).


Finally, run the following command to enable Natural Scrolling by changing the value from 0 to 1:

xinput set-prop 10 266 1

This example command changes device 10, parameter 266, to the value of 1.

You may need to add this command as a startup application if the changes don't survive a reboot.

mchid avatar
bo flag
The example in this answer is for a mouse but the method is the same for a touchpad: identify the touchpad device id, then the parameter number, and then set the value to 1.
mLstudent33 avatar
ph flag
```nobu@nobu-IdeaPad-3-15IIL05:~$ xinput set-prop 12 316 1 X Error of failed request: BadAccess (attempt to access private resource denied) Major opcode of failed request: 131 (XInputExtension) Minor opcode of failed request: 57 () Serial number of failed request: 20 Current serial number in output stream: 21 ```
mchid avatar
bo flag
@mLstudent33 It looks like `316` is "Natural Scrolling Enabled Default" or the default parameter (for all users). Try using `xinput set-prop 12 315 1` instead.
mchid avatar
bo flag
@mLstudent33 Since the "default" parameter is for all users, your user doesn't have permission to change the value of `316`.
mLstudent33 avatar
ph flag
I'll try it but went back to gnome for the time being @mchid. Thanks for following up.
J. Schmidt avatar
cn flag
Could this answer be extended to include the "add this command as a startup application" since these changes do not survive a reboot. I've tried to do this (following https://askubuntu.com/a/598198/653099 ) but without any success...
mchid avatar
bo flag
@J.Schmidt You should have an app installed by default called "startup applications" so search for "startup applications" in your installed apps. Open the startup applications app, create a new startup application and for the name you can put anything like "Natural Scroll" and then for the command, just copy and paste the command you would like to startup like `xinput set-prop 10 266 1` for example.
mchid avatar
bo flag
@J.Schmidt Please let me know if that doesn't work or if you're not sure. Sometimes we need to tell the command to wait a few seconds to give the system time to adjust the settings before running the command so something like `sleep 5; xinput set-prop 10 266 1` would tell the command to wait 5 seconds and then execute the command. Also, it's possible that the `DISPLAY` variable might need to be set. In any case, just let me know if it doesn't work and I will edit it into the answer above.
J. Schmidt avatar
cn flag
@mchid I posted a seperate question on the issue here https://askubuntu.com/questions/1459765/how-to-execute-bash-file-on-ubuntu-unity-startup . To answer your question, there was no need for me to use sleep command. Thanks
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.