Implement passcode-based fullscreen phone locker (locker.so / xlocker)
This commit is contained in:
1 parent
32d5d2f2b4
commit
0656042f7f
56 files changed
+1264
-120
No files matched your search
@@ -22,6 +22,21 @@ transition_can_suspend() {
|
||||
transition() {
|
||||
state="$1"
|
||||
|
||||
if [ "$state" = "unlock" ] && [ -f /tmp/bananarchy_screen_locked ]; then
|
||||
state="lock"
|
||||
printf '%s\n' "$state" > "$SXMO_STATE"
|
||||
sxmo_wm.sh display on >/dev/null 2>&1 &
|
||||
xlocker wake >/dev/null 2>&1 &
|
||||
return 0
|
||||
fi
|
||||
if [ "$state" = "lock" ]; then
|
||||
printf '1\n' > /tmp/bananarchy_screen_locked
|
||||
xlocker >/dev/null 2>&1 &
|
||||
elif [ "$state" = "screenoff" ]; then
|
||||
printf '1\n' > /tmp/bananarchy_screen_locked
|
||||
xlocker screenoff >/dev/null 2>&1 &
|
||||
fi
|
||||
|
||||
sxmo_log "transitioning to stage $state"
|
||||
printf '%s\n' "$state" > "$SXMO_STATE"
|
||||
|
||||
@@ -106,10 +121,16 @@ shift
|
||||
case "$action" in
|
||||
get)
|
||||
read_state
|
||||
if [ -f /tmp/bananarchy_screen_locked ] && [ "$state" = "unlock" ]; then
|
||||
state="lock"
|
||||
fi
|
||||
printf %s "$state"
|
||||
exit 0
|
||||
;;
|
||||
is_locked)
|
||||
if [ -f /tmp/bananarchy_screen_locked ]; then
|
||||
exit 0
|
||||
fi
|
||||
if [ -n "$SXMO_HAS_PEANUTBUTTER" ]; then
|
||||
pidof peanutbutter swaylock waylock i3lock > /dev/null && exit 0
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user