howdy icon indicating copy to clipboard operation
howdy copied to clipboard

Any way to use howdy in a script ?

Open rexackermann opened this issue 2 months ago • 1 comments

I want to use howdy to periodically check if I am the one using the computer. So, it can lock it in case someone else is using it. Maybe use a while loop to check with howdy every n seconds then if I am there it will rerun otherwise lock the system or run a command. Is there a way to achieve it ?

Thank you for the great project !!

rexackermann avatar Oct 24 '25 04:10 rexackermann

Yes, you can install pamtester, and if you have howdy configured for login, you can use something like this script. Install it as a service and it will work.

#!/bin/bash

CHECK_INTERVAL=300

while true; do
    if timeout 5 pamtester login $USER authenticate; then
        echo "$(date): User recognized."
    else
        echo "$(date): User NOT recognized — locking session!"
        loginctl lock-session
    fi

    sleep $CHECK_INTERVAL
done

OlexiyOdarchuk avatar Nov 05 '25 03:11 OlexiyOdarchuk