Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- from os import system
- from subprocess import Popen, PIPE
- from re import findall
- # Get Logitech Wireless Mouse device ID
- mouse_ids = findall(
- r'\\tid=(\d+)',
- str(Popen(
- 'xinput list | grep -i "Logitech Wireless Mouse"',
- stdout=PIPE,
- shell=True
- ).communicate()[0])
- )
- if not mouse_ids:
- print("Error: Logitech Wireless Mouse not found!")
- exit(1)
- for device_id in mouse_ids:
- # Disable natural scrolling (traditional scroll direction)
- system(f'xinput set-prop {device_id} "libinput Natural Scrolling Enabled" 0')
- # Disable high-resolution smooth scrolling
- system(f'xinput set-prop {device_id} "libinput High Resolution Wheel Scroll Enabled" 1')
- # Disable horizontal scrolling
- system(f'xinput set-prop {device_id} "libinput Horizontal Scroll Enabled" 0')
- # Slow down cursor sensitivity (65% speed)
- system(
- f'xinput set-prop {device_id} "Coordinate Transformation Matrix" '
- '0.550000, 0.000000, 0.000000, '
- '0.000000, 0.550000, 0.000000, '
- '0.000000, 0.000000, 0.500000' # Fixed last value (must be 1.0)
- )
- print(f"Applied settings to Logitech Wireless Mouse (ID: {device_id})")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement