OnOff SHIM with analog switch

Hi. I have an analog button that toggles to always On and always Off. Looks like this:

I was wondering how could I make the OnOff SHIM work with it so that when the lever is set to On the Raspberry Pi will power on and when he lever is toggled to Off the Raspberry Pi will perform a clean shutdown.

Thank you in advance.

Thats not easily done, if possible at all. The on off shim wants a momentary contact switch, not a latching switch. Press (shorted) and release (open circuit), like an arcade button. There is another thread here where somebody tried to use a switch like that and it didn’t work. The Pi didn’t fully boot up if I remeber correctly.

Thank you. That is good to know. I do have a nice momentary contact switch but I would have liked to use this one. Will find a good use for it in another project. Thank you for your reply. :)