I wanted to use an extra microswitch I had (these: https://smile.amazon.com/dp/B088W8WMTB) as a filament runout detection sensor, but most designs I found were either too bulky, used a different style switch, or made for a specific printer.
Since taking the pics and uploading, I have shrunken the design even further. The body is now 25.1 x 11.65 millimeters.
Heavily inspired by eussrh's design (https://www.thingiverse.com/thing:1698397). After finishing up the design and looking back for their Thing, I did find a couple other designs that are essentially the same as mine! This one (https://www.thingiverse.com/thing:4260567) I didn't find because I was searching for "microswitch" instead of "endstop" sensors, and this one (https://www.thingiverse.com/thing:2665162) I ignored in the search results because of the name. They are both great designs and the remixes might have exactly what you are looking for!
Also included is a version with a hole for an M3 T-nut mount to a 2020 extrusion if you want a fixed position sensor. This is the one I'm using for my reverse bowden setup on my Mercury One Ender 5.
BOM:
1x Microswitch - levered
2x M2 SHCS, 5mm or 6mm length
2x M2 hex nuts
Some cable with a connector to interface with your board
OPTIONAL:
1x M3 SHCS, 8mm length
1x M3 T-nut
Printing notes:
I designed this to be printed without supports. The hex nut holes and the directional arrow are 'stepped' so that they can be bridged easier. It's a nice design technique for 3D printing that I don't remember where I saw it first.. but I sure didn't come up with it
The author hasn't provided the model origin yet.