summaryrefslogtreecommitdiffstats
path: root/unlock
blob: fd7a493999843af02c5671830a76c591bf6c96c7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/data/data/com.termux/files/usr/bin/bash
#Dependecies: termux-api, openssh, jq

toast() {
	termux-toast -g bottem -b black $1
}

# Try to unlock
FINGERPRINT=$(termux-fingerprint | jq '.auth_result | contains("SUCCESS")')
if ( "$FINGERPRINT"); then
	ssh pc "pkill slock"
	toast "Success"
else
	toast "Failed"
fi

exit 0