This trick can also be used to map the back/forward buttons on the mouse. Here we can’t use D-Bus, since we want to “talk” to the active window and not a specific application. Fortunately for us, most applications use the key shortcuts Alt+Left and Alt+Right for Back and Forward, respectively. In other words, we can do something like this:
# Back
"xte 'keydown Alt_L' 'key Left' 'keyup Alt_L'"
b:6
# Forward
"xte 'keydown Alt_L' 'key Right' 'keyup Alt_L'"
b:7