You mean a very simple algorithm to detect eyes using the OpenCV (https://en.wikipedia.org/wiki/OpenCV) written on a RaspberryPi that has a tiny camera which connects to your desired computer via network (be it WiFi or cable) and sends a shutdown command once it no longer detects them? I am pretty sure you can find on SlackOverflow (pun intended) / RaspberryPi forums desired bits of software and make do in maximum one day.