Add check if screen is still locked after timeout
parent
2d3c6dec21
commit
a8cc54391c
@ -1,7 +1,18 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
is_screen_locked()
|
||||||
|
{
|
||||||
|
if dbus-send --session --dest=org.freedesktop.ScreenSaver --type=method_call --print-reply /org/freedesktop/ScreenSaver org.freedesktop.ScreenSaver.GetActive | grep 'boolean true' > /dev/null; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Sleep to timeout
|
# Sleep to timeout
|
||||||
sleep 15
|
sleep 15
|
||||||
|
|
||||||
# Disable screens
|
if is_screen_locked; then
|
||||||
xset dpms force off
|
# Disable screens
|
||||||
|
xset dpms force off
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue