The Mercury is in a glass tube with two wires and the tube is attached to the bimetallic strip in such a way that the motion of the Mercury due to gravity as the strip moves will close the circuit between the two wires. The Mercury is just being used a liquid conductor.
This exists. https://www.libreoffice.org/ Great stuff 👍