Lubuntu
linux Tips (2015-2022) |
Setting your mouse
speed This is a way to setup your mouse speed. Create a Script Harmony with Xorg Flat Acceleration Going back to evdev (updated
for lubuntu 20.04, 22.04)
|
The most basic
device you need for a desktop. Amazingly for decades, Linux has
still managed to make it difficult for users to easily setup their
newly bought high resolution pointers You buy a new mouse. Plug it in and boot up your OS only to find the mouse too fast, too slow not 'feeling' quite right? You try the regular mouse adjuster panel but it makes no difference,. What to do? The traditional way to set up a mouse is via xorg.conf. Since the new auto-detection scheme, the Ubuntu based distros added /usr/share/X11/xorg.conf.d to the mix, as if it wasn't already difficult enough. It is basically the xorg.conf files that have been divided up into levels of execution. For most distros, input is now handled by libinput which replaces evdev + xset. There are far fewer options, you can only set the acceleration and there are only two profiles to choose from. Here I'll show you how to fix you mouse speed for Lubuntu. xinput This command gets information about devices; 1. Open a terminal and type xinput list --short
And you can guess (in this case) the mouse device ID as 10.
(it will be different for
yours).You'll get something like this; ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ SIGMACHIP USB Keyboard id=9 [slave pointer (2)] ⎜ ↳ 2.4G Wireless Optical Mouse id=10 [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)] ↳ Power Button id=7 [slave keyboard (3)] ↳ SIGMACHIP USB Keyboard id=8 [slave keyboard (3)] [2]+ Done leafpad upback (wd: ~/utils) Once you know how to get the ID, you can use it in a script.. 2. Create the script $ cd
~
$ <your_editor> fixmouse.sh
The NAME='Wireless' line is the device ID. You should replace the word 'Wireless' with a word you see from xinput list --short. The key command here is xinput --set-prop $ID "libinput Accel Speed" -0.80 which set decelerates (negative acceleration). It's value is between -1 and 1. So e.g -0.99 will hardly move the pointer and 1 is the maximum speed. To run it, first make it executable; $ chmod 775 fixmouse.sh Then run it $ ./fixmouse.sh Example output : Wireless Mouse ID
is 11
libinput Accel Speed (283): -0.800000 libinput Accel Speed Default (284): 0.000000 libinput Accel Profiles Available (285): 1, 1 libinput Accel Profile Enabled (286): 1, 0 libinput Accel Profile Enabled Default (287): 1, 0 3. If you want to run this script every time you login, then see, < lubuntu-autostart > Your session manager might still override both xorg
and your autostart script. If this is the case, then to disable
lxsession effects, comment out these lines in;
~/.config/lxsession/Lubuntu/desktop.conf (for LXQt, the settings are inside ~/.config/lxqt/session.conf and they will be different) [Mouse] #AccFactor=50 ** Make sure these #AccThreshold=50 ** lines are commented out LeftHanded=0 (and do not adjust the mouse settings in preferences>keyboard&mouse, as this will add back the entries) Hot Tip for those who 'do' want to use lxsession settings; Acceleration = AccFactor /10 Sensitivity = 110-AccThreshold 4. If you want to attach your script to a hotkey in openbox, then see here. Harmony with XORG You can infact duplicate these settings in xorg. And it will be what you end up doing once you have them setup just the way you want. Normally, Xorg is the first to set the mouse speed at boot-up, followed by lxsession/lxqt, followed by your scripts. If you use xorg settings, then you should disable your scripts and comment out the mouse settings in ~/.config/lxsession/Lubuntu/desktop.conf or ~/.config/lxqt/session.conf. Xorg is also the default setting after any KVM switch, (i.e when you toggle between two PCs with the same keyboard) so you might want to do this if you are using a KVM. To get Xorg to load your settings at boot, create an Xorg conf file (if one does not already exist) inside /usr/share/X11/xorg.conf.d/ e.g /usr/share/X11/xorg.conf.d/45-mouse.conf Section "InputClass"
Identifier "mouse" MatchDriver "libinput" MatchIsPointer "yes" Option "AccelSpeed" "-0.80" EndSection To activate, logout and log back in. Notes: The Xorg config is the default after KVM switching, so it will be the most convenient if you use a KVM, otherwise you will have to execute a script after every KVM switch. Flat Acceleration This is an alternative technique to slow down your mouse using the Xorg conf file. If you still feel the mouse moves or feels weird, even though you have slowed it down with AccelSpeed, then you can opt to have a 'flat' acceleration profile (the default is 'adaptive'). e.g /usr/share/X11/xorg.conf.d/45-mouse.conf Section "InputClass"
Identifier "mouse" MatchDriver "libinput" MatchIsPointer "yes" Option "AccelSpeed" "-0.3" Option "AccelProfile" "flat" EndSection A flat profile, requires less deceleration (negative AccelSpeed) and is the closest thing you can get to 'constant' speed. In this case AccelSpeed behaves more like speed than acceleration. Going Back to evdev Still not satisfied ? You can always go back to evdev, it offers a lot more options. 1. Install the evdev input for xorg Here is a script for testing in evdev; There are 4 settings that are most useful.End. |
||||||||||||||||
Advertisement Space [ More Lubuntu Tips, Home ] |