echo "${PN}: wrapper script to lock desktop
This script is a wrapper to lock your desktop session
-through the vlock application.
+through the physlock application.
Usage: just execute $PN without any further options."
exit 0
if [ -r /etc/grml/script-functions ] ; then
. /etc/grml/script-functions
- check4progs vlock sudo chpasswd dialog || { echo "Sorry, necessary tools missing - can not continue. Exiting.">&2 ; exit 1 ; }
+ check4progs physlock sudo chpasswd dialog || { echo "Sorry, necessary tools missing - can not continue. Exiting.">&2 ; exit 1 ; }
fi
PWD_TEXT1="Set password (hidden typing):"
fi
lock_desktop() {
- vlock -a -n -s
+ # be backwards compatible, see https://github.com/grml/grml/issues/87
+ if physlock --help 2>&1 | grep -q -- '-u user' ; then
+ sudo physlock -u "$USER"
+ else
+ sudo physlock
+ fi
}
is_passwd_set() {
if [ "$PASSWD1" = "$PASSWD2" ] ; then
echo "$USER:$PASSWD2" | sudo chpasswd
else
- $DIALOG --title "$PN" --msgbox "Error: passwords to not match. Exiting." 0 0
+ $DIALOG --title "$PN" --msgbox "Error: passwords do not match. Exiting." 0 0
exit 1
fi
}