It's not open source but I have to shout out Steermouse which has been replacing Logitech's awful Mac software for ~25 years
What really took it to the next level for me were adding chord mappings. For example I can hold right mouse button + scroll the thumb wheel to adjust volume. So convenient!