I used to think I found the perfect, stable, boring system with Debian + KDE Plasma.
I installed it.
I left literally everything on default.
I booted it.
Everything worked out of the box.
I was looking forward to a perfect, stable, boring computing experience.
My cat walked across the keyboard and crashed the OS.
It rebooted to a blinking cursor and nothing else.

So if you’re hiring a software quality assurance engineer, her salary expectation is 80k kitty treats, a corner office overlooking a park with squirrels, and an assistant who will pet her at work and doesn’t mind getting their earlobes nibbled.

  • Skull giver@popplesburger.hilciferous.nl
    link
    fedilink
    arrow-up
    16
    ·
    7 months ago

    Based on this code I stole:

    CatLock.py
    import cv2  
    import os
    import time
    
    # Put https://raw.githubusercontent.com/opencv/opencv/master/data/haarcascades/haarcascade_frontalcatface.xml in the script's working directory
    face_cascade = cv2.CascadeClassifier('haarcascade_frontalcatface.xml')  
    cap = cv2.VideoCapture(0)
    
    while 1:
        ret, img = cap.read()  
        gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)  
        faces = face_cascade.detectMultiScale(gray, 1.3, 5)  
    
        if len(faces) > 0:
            # replace the command below to match your DE's lock command
            # this is for X11 Gnome
            os.popen('gnome-screensaver-command --lock')
        time.sleep(100) # wait 100ms not to overload the CPU
    

    Requires the opencv package (sudo apt install python3-opencv or pip install opencv-python)