simply bind a mouse button to a command
% make
% make install
This will create by default xbmouse
xbmouse -b 8 xkev -e XF86_Back
xbmouse -b 9 xkev -e XF86_Forward
xbmouse -b 16 xkev -e XF86_AudioMute
git clone https://github.com/vlaadbrain/xbmouse.git