使用imwheel解决vmware下linux虚拟机滚轮移动卡顿的问题

Spent some time trying to figure out why mouse scrolling was so awkward in the default terminal on Kali. Turns out, if you move the mouse while using the scroll wheel, the scrolling stops. And so I found a solution.

Install imwheel

kali@kali:~$ sudo apt install imwheel
Test the scrolling behavior with:

kali@kali:~$ imwheel -b "4 5"
...
kali@kali:~$ ls -lsa /usr/bin
Add the command to your .bashrc or .zshrc:

# Start imwheel for scrolling fix and silence output:
imwheel -b "4 5" > /dev/null 2>&1
Also found other possible solutions but they didn't work for me:

Add the following to your VMs .vmx file:

mouse.vusb.enable = "TRUE"
mouse.vusb.useBasicMouse = "FALSE"
Also, going to Edit > Preferences > Input. Set "Optimize Mouse for Games" to "always" will fix the scrolling behavior, but will capture your cursor to the VM Window and it may mess up the sensitivity for you.

To avoid starting IMWheel manually, you can run it as part of your systemd startup.

Example:

~/.config/systemd/user/imwheel.service

[Unit]
Description=IMWheel
Wants=display-manager.service
After=display-manager.service

[Service]
Type=simple
Environment=XAUTHORITY=%h/.Xauthority
ExecStart=/usr/bin/imwheel -d
ExecStop=/usr/bin/pkill imwheel
RemainAfterExit=yes

[Install]
WantedBy=graphical-session.target

此处评论已关闭