In some situations, a screenlock that comes without a warning can cause disruption. To circumvent this problem, you can set a visible countdown before the screen is locked. Additionally, you can define a shell command that is executed when the countdown reaches 0.