Unlock your notebook with a magnetic lid switch pattern!

edited October 2015 in Magnets
After getting my implant a bit over a month ago, I looked into reading the lid open/close events on my laptop, since I found out I could turn the screen off at the touch of my finger (in the right spot).
The lid switch is a small magnetic sensor somewhere on the surface of most laptops that detects the field of a small magnet embedded in the opposite side of the laptop to shut off the display and suspend the pc.

I wrote a little python script that can recognize simple patterns of lidswitch presses based on length and keypresses:


It works on linux and [i]should[/i] work on mac Os X too.

Sorry for the terribly written post, I'm typing on mobile on the bus. I'll update with a video some time next week (hopefully).


  • This sounds pretty interesting; any way to get this running on Windows?
  • There probably is a way to get something running on windows, but I don't know the architecture there and it could very well be that the software would need to be a driver to access the information there.

    I am using evdev, which as I just found out is completely linux specific, meaning mac os isn't possible either. I will look if I find a cross-platform library/level to work on, but I'm afraid I won't be able to work on that simply because I don't have installs of windows or mac to play around with.
  • This can definitely be done in windows. Powershell has the ability to monitor for a lid closing event since windows 7. If there is some interest, I think I can get something written in the next week or so.
  • edited October 2015

    made a little video showing some things - not sure whether I can embed it here?
Sign In or Register to comment.