dotfiles/.local/scripts/trackball.sh

14 lines
392 B
Bash
Executable File

#!/bin/sh
# Set mouse buttons for elecom
# 3 = 9 (forward)
# 8 = 3 (right click)
# 9 = 2 (middle click)
# 10 = 8 (back)
dev_id=$(xinput | rg "slave\s+pointer" | rg ELECOM | rg -o "id=(\d+)" -r '$1')
if [ -n "$dev_id" ]; then
xinput set-button-map $dev_id 1 2 9 4 5 6 7 2 3 8
echo "Button mapping applied" >> /tmp/trackball.log
else
echo "No device found" >> /tmp/trackball.log
fi