Przyspieszenie kursora myszy ponad ustawienia programowe
Jeśli zauważysz że w którym momencie dobrze działające pakiety lub sterowniki niewiedzieć czemu w nowszych dystrybucjach Linux są zastąpione innymi pozbawionymi potrzebnej funkcjonalności, to niestety takich przypadków jest wiele, driver odpowiedzialny za sterowanie kursorem myszy jest jednym z przykładów. Ponieważ graficzny konfigurator stał się bezużyteczny, trzeba sięgnać do konsoli.
Standardowo do zwiększania prędkości kusora myszy użylibyśmy polecenia:
xinput --set-prop "A4Tech USB Mouse" "Device Accel Constant Deceleration" 1 property 'Device Accel Constant Deceleration' doesn't exist, you need to specify its type and format
niestety od którejś wersji XORG (1.19 bodajże) sterownik dotychczas używany do myszy (evdev
) został zastąpiony libinput
które prakczynie nie daje żadnego pola do manewru, sprawdźmy
xinput --list-props "A4Tech USB Mouse" Device 'A4Tech USB Mouse': Device Enabled (172): 1 Coordinate Transformation Matrix (174): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 libinput Natural Scrolling Enabled (309): 0 libinput Natural Scrolling Enabled Default (310): 0 libinput Scroll Methods Available (313): 0, 0, 1 libinput Scroll Method Enabled (314): 0, 0, 0 libinput Scroll Method Enabled Default (315): 0, 0, 0 libinput Button Scrolling Button (316): 2 libinput Button Scrolling Button Default (317): 2 libinput Middle Emulation Enabled (318): 1 libinput Middle Emulation Enabled Default (319): 0 libinput Accel Speed (320): 1.000000 libinput Accel Speed Default (321): 0.000000 libinput Accel Profiles Available (322): 1, 1 libinput Accel Profile Enabled (323): 1, 0 libinput Accel Profile Enabled Default (324): 1, 0 libinput Left Handed Enabled (325): 0 libinput Left Handed Enabled Default (326): 0 libinput Send Events Modes Available (294): 1, 0 libinput Send Events Mode Enabled (295): 0, 0 libinput Send Events Mode Enabled Default (296): 0, 0 Device Node (297): "/dev/input/event5" Device Product ID (298): 2522, 49418 libinput Drag Lock Buttons (311): <no items> libinput Horizontal Scroll Enabled (312): 1
A zatem w nowszych dystrybucjach Ubuntu i Linux Mint mamy tylko „libinput Accell Speed”, który może przyjąć maksymalną liczbę „1” (czyt. wciąż prędkość żółwia) i krzyczy brzydkim niezrozumiałym błędem kiedy próbujesz wpisać jakąkolwiek liczbę większą od 1
xinput --set-prop "A4Tech USB Mouse" "libinput Accel Speed" 1.5 X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 131 (XInputExtension) Minor opcode of failed request: 57 () Value in failed request: 0x140 Serial number of failed request: 21 Current serial number in output stream: 22
Dawniej za opcje myszy odpowiadał także Synaptics
ze swoim poleceniem Synclient
jednak obecnie Synaptics ogranicza się tylko do touchpada i zainsalowanie go nie przynosi żadnej poprawy. Również polecenie xset
omawiane w starszych tutorialach, nie pomoże w tym przypadku
Na jednym z forum znalazłem wpis że należy zmienić konfigurację XORG wskazując na poprzedni sterownik
Section "InputClass" Identifier "My Mouse" Driver "evdev" MatchIsPointer "yes" EndSection
i zapisać to jako nowy plik konfiguracyjny, problem w tym że taki katalog (/etc/X11/xorg.conf.d) nie istnieje!
/etc/X11/xorg.conf.d/50-mouse-acceleration.conf
Prawidłowy katalog dla konfiguracji Xorg w nowszych dystrybucjach Ubuntu i Linux Mint to:
/usr/share/X11/xorg.conf.d/
Najpierw potrzebujemy zainstalować sterownik evdev
sudo apt-get install xserver-xorg-input-evdev
O obecności evdev
dowiemy się patrząc na pliki w katalogu /usr/share/X11/xorg.conf.d/
. Evdev utworzył jeden lub dwa własne, podobnie widzimy tutaj konfigurację libinput. Tworząc nasz nowy plik warto aby znajdował się po nich, ponieważ w innym przypadku one mogą nadpisać konfigurację
ls -1 10-amdgpu.conf 10-evdev.conf 10-quirks.conf 10-radeon.conf 40-libinput.conf 70-wacom.conf
touch 51-mouse-custom-speed.conf
Naszym celem jest powiedzienie menedżerowi „Xorg” aby do zarządzania myszką używał drivera „evdev”
Section "InputClass" Identifier "A4Tech USB Mouse" Driver "evdev" MatchIsPointer "yes" # Option can be added here Option "ConstantDeceleration" "0.4" Option "AccelVelocityScaling" "50" EndSection
Oczywiście po takiej zmianie musimy zrestartować Xorg
sudo systemctl restart display-manager
Polecenie xinput
zwróci nam już parametry udostępnione od evdev
:
$xinput --list-props 12 Device 'A4Tech USB Mouse': Device Enabled (172): 1 Coordinate Transformation Matrix (174): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 Device Accel Profile (305): 0 Device Accel Constant Deceleration (306): 0.400000 Device Accel Adaptive Deceleration (307): 1.000000 Device Accel Velocity Scaling (308): 40.000000 Device Product ID (298): 2522, 49418 Device Node (297): "/dev/input/event5" Evdev Axis Inversion (316): 0, 0 Evdev Axes Swap (318): 0 Axis Labels (319): "Rel X" (182), "Rel Y" (183), "Rel Vert Wheel" (315), "None" (0) Button Labels (320): "Button Left" (175), "Button Middle" (176), "Button Right" (177), "Button Wheel Up" (178), "Button Wheel Down" (179), "Button Horiz Wheel Left" (180), "Button Horiz Wheel Right" (181), "Button Side" (299), "Button Extra" (300), "Button Forward" (301), "Button Back" (302), "Button Task" (314), "Button Unknown" (313), "Button Unknown" (313), "Button Unknown" (313), "Button Unknown" (313) Evdev Scrolling Distance (321): 1, 1, 1 Evdev Middle Button Emulation (322): 1 Evdev Middle Button Timeout (323): 50 Evdev Middle Button Button (324): 2 Evdev Third Button Emulation (325): 0 Evdev Third Button Emulation Timeout (326): 1000 Evdev Third Button Emulation Button (327): 3 Evdev Third Button Emulation Threshold (328): 20 Evdev Wheel Emulation (329): 0 Evdev Wheel Emulation Axes (330): 0, 0, 4, 5 Evdev Wheel Emulation Inertia (331): 10 Evdev Wheel Emulation Timeout (332): 200 Evdev Wheel Emulation Button (333): 4 Evdev Drag Lock Buttons (334): 0
W nowym pliku .conf teoretycznie od razu możemy ustawić potrzebne parametry odpowiedzialne za szybkość kursora myszy. Jednak i tu przychodzi zaskoczenie ktróre trzeba rozwiązywać metodą prób i błędów, opcja ustawiana w xinput
jako Device Accel Constant Deceleration
tutaj powinna brzmieć „ConstantDeceleration” z wartościami podanymi w cudzysłowie, nie wiem jakiej nazwy parametru użyć do "Device Accel Velocity Scaling"
, jednak eksperymentowanie w tym pliku łatwo kończy się tym że środowisko graficzne się nie uruchomi, (tak długo dopóki nie poprawisz pliku w konsoli).
Ponieważ konfiguracja zadziałała tylko częściowo, pozostaje stara sprawdzona metoda ręcznego stworzenia pliku, preferowany przeze mnie plik to ~/.scripts/mouse-ready.sh
z treścią następującą:
xinput --set-prop "A4Tech USB Mouse" "Device Accel Velocity Scaling" 40 xinput --set-prop "A4Tech USB Mouse" "Device Accel Constant Deceleration" 0.4
Taki plik po dodaniu uprawnień do uruchamiania (sudo chmod a+x mouse-ready.sh
) mogę uruchomić ręcznie lub dodać go do programów startowych.
źródła:
https://www.reddit.com/r/linuxquestions/comments/65go7a/kubuntu_1704_xinput_does_not_show_property_device/
https://wiki.archlinux.org/title/Mouse_acceleration#Mouse_speed_with_libinput
https://man.archlinux.org/man/libinput.4
https://en.wikipedia.org/wiki/Evdev
https://en.wikipedia.org/wiki/Evdev
https://www.linuxquestions.org/questions/slackware-14/xinput-and-mouse-deceleration-dude-4175617417/
https://wiki.archlinux.org/title/Mouse_acceleration
https://bbs.archlinux.org/viewtopic.php?id=228985
https://askubuntu.com/questions/255890/how-can-i-adjust-the-mouse-scroll-speed/1278266#1278266
Komentarze
One comment
działa, dzięki piękne!!