Advertisement
plirof2

linux set mouse speed if MS mouse

Nov 28th, 2024 (edited)
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.86 KB | None | 0 0
  1. #Here’s a script that checks the mouse brand and adjusts the xset settings accordingly:
  2. #one liner vesrion : MOUSE_NAME=$(xinput list --name-only | grep -i 'mouse'); if echo "$MOUSE_NAME" | grep -qi 'SIGMACHIP'; then xset m 2 7; elif echo "$MOUSE_NAME" | grep -qi 'Microsoft'; then xset m 3 8; else xset m 3 8; fi
  3.  
  4. bash
  5. Αντιγραφή κώδικα
  6. #!/bin/bash
  7.  
  8. # Get the name of the mouse (assuming there's only one device)
  9. MOUSE_NAME=$(xinput list --name-only | grep -i 'mouse')
  10.  
  11. # Check if the mouse is of brand "XXXXX" (case-insensitive match)
  12. if echo "$MOUSE_NAME" | grep -qi 'SIGMACHIP'; then
  13.     # If it's brand SIGMACHIP (Powertech), set acceleration to 2 and threshold to 7
  14.     xset m 2 7
  15. else if echo "$MOUSE_NAME" | grep -qi 'Microsoft'; then
  16.     xset m 3 8
  17. else
  18.     # If it's another mouse, set acceleration to 3 and threshold to 8
  19.     xset m 3 8
  20. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement