I have a program run on the background that simply take a screenshot every N seconds.
eg:
#!/bin/sh
while true; do
take-screenshot
sleep 10
done
What I want to achieve is only take screenshot if screen is not locking. eg:
#!/bin/sh
while true; do
if ! screen-is-locking; then
take-screenshot
sleep 10
fi
done
How can I determine if my desktop is locking in command line?