56

I've recently switched to Ubuntu, and the one thing that has been bothering me is the scroll speed, which I can't seem to change. In windows I used to have it set around 7 lines, but it seem to be around 3 on Ubuntu, and unchangeable. How can I change the speed?

Braiam
  • 67,791
  • 32
  • 179
  • 269
John Howard
  • 2,035

12 Answers12

34

If it's only for web, you can change the scroll speed in FireFox:

  • Edit menu > Preferences > Advanced tab > Browsing group: disable smooth scrolling

Fine-tuning:

  • Type enter about:config in the address bar
  • Find and change mousewheel.withnokey.sysnumlines to FALSE
  • Then change the mousewheel.withnokey.numlines from 1 to whatever you want.

  • For Firefox versions 73.3.1 and later: - change the mousewheel.min_line_scroll_amount from 1 to whatever you want.

And a more general, system-wide solution:

Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83
MestreLion
  • 20,086
29

Just unplug the mouse (mine was wireless), and then plug it back in to fix this issue.

I was searching for a long time for this fix and even rebooted the machine to no avail.

Maybe a full shutdown would have fixed the issue.

Madivad
  • 687
23

For Ubuntu 12.10 I found that it it a little different for the Firefox work around.

Open about:config (type it into the address bar) and search for:

mousewheel.min_line_scroll_amount

Then change the number associated with it. Mine was set to 5. I changed it to 60 and it works how I want it now.

Eliah Kagan
  • 117,780
Phydoux
  • 231
  • 1
    Thanks! I found that option myself but didn't try that high a number, just something like 10. But together with smooth scrolling it seems that much higher numbers are in order to reach barely sufficient scroll speeds. Currently got mine set to 100. – nem75 Jan 11 '13 at 12:40
5

This tutorial worked for me:

  1. Open a terminal and run: sudo apt-get install imwheel
  2. gedit ~/.imwheelrc
  3. Paste this, save, and close gedit:

    ".*"
    None,      Up,   Button4, 3
    None,      Down, Button5, 3
    Control_L, Up,   Control_L|Button4
    Control_L, Down, Control_L|Button5
    Shift_L,   Up,   Shift_L|Button4
    Shift_L,   Down, Shift_L|Button5
    
  4. imwheel --kill --buttons "4 5"

  5. Add the previous line to ~/.bashrc or your session autostart manager.

  • While this does work - on a laptop, when I sometimes use a mouse, and sometimes the trackpad, this causes some buggy behaviour with the trackpad. – Novocaine Apr 21 '21 at 10:08
5

In Firefox 19, run about:config in the address bar, then modify the parameter mousewheel.min_line_scroll_amount to something higher (50). You don't have to restart FF.

tirenweb
  • 440
4

I have Firefox 42.0 here, and I use a touchpad to scroll.

I found if I wanted to adjust the distance scrolled, I could change:

mousewheel.default.delta_multiplier_y

in about:config. Its default value was 100. A larger value would scroll further/faster.

joeytwiddle
  • 1,957
2

Chromium Wheel Smooth Scroller

In Chrome, this is The Soluttion: https://chrome.google.com/webstore/detail/chromium-wheel-smooth-scr/khpcanbeojalbkpgpmjpdkjnkfcgfkhb

Just brilliant!

Zoltan
  • 508
1

If you use two fingers on a touchpad to scroll, you can use synclient to adjust the sensitivity for the whole system.

If you don't have it installed:

sudo apt-get install xserver-xorg-input-synaptics

To see the current sensitivity threshold, check the output of:

synclient -l | grep ScrollDelta

To make it more sensitive, reduce the value:

synclient VertScrollDelta=33

This means you need to move your finger less to send each scroll event.

If you want to reverse the scroll direction, like Mac OS X's "natural scrolling", set a negative value.

But note that this will not let you configure the minimum distance scrolled when you move your fingers only a little bit. That must be configured per-app (or possibly per-desktop environment).

joeytwiddle
  • 1,957
0

For those, who prefer to fix it Linux Desktop Way.

Wrote exhaustive instruction on how to add Scroll Ratio through libinput sources:

https://github.com/up-to-you/linux_notes/blob/master/mouse/scroll_speed.md

For those, who hates github (gitlab funs?), duplicated here (works for any mouse):

find libinput files

sudo updatedb
ll $(locate -A libinput.so)

most likely Canonical delivers their libinput libs with snaps

sudo snap list
sudo snap remove gnome-3-28-1804

check, that libinput lefts only in system folder, like : /usr/lib/x86_64-linux-gnu/libinput.so /usr/lib/x86_64-linux-gnu/libinput.so.10 /usr/lib/x86_64-linux-gnu/libinput.so.10.13.0

ll $(locate -A libinput.so)

clone libinput source

git clone https://gitlab.freedesktop.org/libinput/libinput
cd libinput

modify src/evdev.c. Find evdev_read_wheel_click_props function and init angles.y = 361;

static inline struct wheel_angle
evdev_read_wheel_click_props(struct evdev_device *device)
{
    struct wheel_angle angles;
    const char *wheel_count = "MOUSE_WHEEL_CLICK_COUNT";
    const char *wheel_angle = "MOUSE_WHEEL_CLICK_ANGLE";
    const char *hwheel_count = "MOUSE_WHEEL_CLICK_COUNT_HORIZONTAL";
    const char *hwheel_angle = "MOUSE_WHEEL_CLICK_ANGLE_HORIZONTAL";

    /* CLICK_COUNT overrides CLICK_ANGLE */
    if (evdev_read_wheel_click_count_prop(device, wheel_count, &angles.y) ||
        evdev_read_wheel_click_prop(device, wheel_angle, &angles.y)) {
        evdev_log_debug(device,
                "wheel: vert click angle: %.2f\n", angles.y);
    }
    if (evdev_read_wheel_click_count_prop(device, hwheel_count, &angles.x) ||
        evdev_read_wheel_click_prop(device, hwheel_angle, &angles.x)) {
        evdev_log_debug(device,
                "wheel: horizontal click angle: %.2f\n", angles.y);
    } else {
        angles.x = angles.y;
    }
    // since, src/util-prop-parsers.c : abs(angle) > 360
    angles.y = 361;

    return angles;
}

modify src/libinput.c. Find libinput_event_pointer_get_axis_value_discrete function and apply scroll ratio as you wish:

LIBINPUT_EXPORT double
libinput_event_pointer_get_axis_value_discrete(struct libinput_event_pointer *event,
                           enum libinput_pointer_axis axis)
{
    struct libinput *libinput = event->base.device->seat->libinput;
    double value = 0;

    require_event_type(libinput_event_get_context(&event->base),
               event->base.type,
               0.0,
               LIBINPUT_EVENT_POINTER_AXIS);

    if (!libinput_event_pointer_has_axis(event, axis)) {
        log_bug_client(libinput, "value requested for unset axis\n");
    } else {
        switch (axis) {
        case LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL:
      // x5 ratio for horizontal scrolling
            value = event->discrete.x * 5;
            break;
        case LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL:
      // x5 ratio for vertical scrolling
            value = event->discrete.y * 5;
            break;
        }
    }
    return value;
}

Prepare build directory (dependencies installation required):

meson --prefix=/usr builddir/ -Ddocumentation=false

Compile and install:

ninja -C builddir/ && sudo ninja -C builddir/ install

Verify location:

sudo updatedb
ll $(locate -A libinput.so)

Logout / Login , use.

uptoyou
  • 867
0

For Ubuntu 20.04 LTS I have made good experience with mousewheel.system_scroll_override_on_root_content.enabled set to true. This keeps the mousewheel.min_line_scroll_amount intact, which is good for precision. You can additionally set the scroll factor higher: mousewheel.system_scroll_override_on_root_content.vertical.factor (default. 200).

Firefox 80 / about:config

  1. Set mousewheel.system_scroll_override_on_root_content.enabled to true
  2. (optionally) Increase mousewheel.system_scroll_override_on_root_content.vertical.factor (default. 200)
0

I also wanted to increase the mouse scroll wheel acceleration, and not just the absolute speed. This is a feature in MacOSX but not builtin for Xorg (also Wayland) yet.

I implemented such a feature in user space here (mouse-scroll-wheel-acceleration-userspace). This will increase the scroll speed, or accelerate the scroll speed. You would just run this in the background, with your preferred options. The code is quite simple Python code, and should be easy to modify as well.

Albert
  • 2,577
0

Even if the unplug/plug trick does fix the issue this is not a really good solution

One solution I found is to add

xinput set-prop 10 'Evdev Scrolling Distance' 10 10 10

at the end of my .profile file (or wherever it gets executed once per graphical login)

In the case of my Microsoft mouse the default values were 1 1 1 which are way too sensitive.

10 10 10 are right for me.

I didn't take the time to see what each number actually means

Vitor Abella
  • 7,537
  • 1
    the number immediately following set-prop is the device ID (I believe.) You can check this with xinput list. You'll see your device IDs listed in order.

    Get the available properties with xinput list-props [id]

    – emf Dec 20 '18 at 18:13
  • Here's what the Evdev params mean: https://unix.stackexchange.com/a/442666 – Sam Jul 01 '19 at 10:12