The output from razer-cli --dpi print is just my dpi (1400).
Okay. Something like this should work:
#!/bin/bash
dpi=$(razer-cli --dpi print)
case $dpi in
1400)
razer-cli --dpi 20000
;;
20000)
razer-cli --dpi 1400
;;
esac
If the resolutions you want are 1400 and 20000 dpi.
save it as cycle.sh or something like that in a directory in your PATH, and chmod +x it to make it executable. Every time it runs, it'll cycle though resolutions. Can add more resolutions or fiddle with the colors or whatever there too.
Cinnamon
Okay. I haven't used any GNOME stuff in ages, but it sounds like Cinnamon's keyboard applet only does keyboard bindings, so can't bind a mouse button to a command.
https://github.com/linuxmint/cinnamon/issues/12840
I don't know what the best route to run a command on mouse click is under Cinnamon is.