idek whats in here, there might even be some password idk
This commit is contained in:
27
scripts/i3lock-finger
Executable file
27
scripts/i3lock-finger
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ensure the directory for failed fingerprint images exists
|
||||
mkdir -p ~/pictures/failed_finger
|
||||
|
||||
# Lock the screen with all passed arguments
|
||||
i3lock "$@" &
|
||||
|
||||
while true; do
|
||||
# Run the fingerprint verification and redirect output to /dev/null
|
||||
fprintd-verify &> /dev/null
|
||||
|
||||
# Capture the exit code
|
||||
exit_code=$?
|
||||
|
||||
# Check the exit code
|
||||
if [ $exit_code -eq 0 ]; then
|
||||
pkill i3lock
|
||||
exit 0
|
||||
elif [ $exit_code -eq 1 ]; then
|
||||
timestamp=$(date "+%Y%m%d_%H%M%S")
|
||||
timestamp_human=$(date -d "${timestamp:0:8} ${timestamp:9:2}:${timestamp:11:2}:${timestamp:13:2}" "+%Y-%h-%d %H:%M:%S")
|
||||
ffmpeg -f video4linux2 -s 1280x720 -i /dev/video0 -frames:v 1 ~/pictures/failed_finger/$timestamp.png
|
||||
kdeconnect-cli --device $(kdeconnect-cli -a --id-only) --ping-msg "Failed to unlock at $timestamp_human"
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user