Skip to content

Commit a0adc20

Browse files
committed
Allow to lock screen when tag is removed
1 parent 385791e commit a0adc20

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

erawrim/erawrim-ctl

+16
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,22 @@ prepare_home ()
4545
then
4646
echo "#!/bin/bash" > $ERAWRIM_PATH/defaut/retire.sh;
4747
echo "# Gestionnaire par défaut lors du retrait d'un Ztamp" >> $ERAWRIM_PATH/defaut/retire.sh;
48+
cat >> $ERAWRIM_PATH/defaut/retire.sh << EOF
49+
# Handle .authtag used by pam_reflect
50+
# pam_reflect allows authentication when tag is inserted,
51+
# and here, we manage to lock screen when tag is removed.
52+
if [ -r $HOME/.authtag -a "$1" = "`cat $HOME/.authtag`" ]
53+
then
54+
# Verrouiller l'écran
55+
# Fonctionne pour le bureau Gnome
56+
# gnome-screensaver-command -l
57+
58+
# Sur bureau récent
59+
# dbus-send --session --dest=org.freedesktop.ScreenSaver \
60+
# --type=method_call --print-reply /ScreenSaver \
61+
# org.freedesktop.ScreenSaver.Lock
62+
fi
63+
EOF
4864
fi;
4965

5066
chmod +x $ERAWRIM_PATH/defaut/pose.sh $ERAWRIM_PATH/defaut/retire.sh

0 commit comments

Comments
 (0)