Lock the screen in time

I set the time for automatically locking screen for Screen Locking, but it really depends on the applications running, when Firefox playing videos, or VMs running and displayed above other windows, the automatically locking screen loss its function.Tell me please how to lock screen in time no matter what is running?

To begin with, the screen locking you want is in your desktop environment. Thus please tell us which one you use (Gnome, KDE, …).

Hi pcxt. Regarding vlc, there is an option in the settings to disable/enable screen lock. There is certainly the same kind of option in for firefox.

Gnome and KDE are my regular use.

Couldn’t find the option in firefox, and also Virtualbox

OK, thanks. Then the different people who use those DEs can maybe add their knowldege of how to configure each one of them in this aspect.

BTW, I find this a bit curious question.
There was a time that screens were switched off after a certain time of no user action (on the keyboard) mainly because screens showed wear at the top left where most of the text was put. Later, when graphical UIs where invented, that changed to showing so called “screen savers” (again to prevent wear of the screen, but not by switching it off, but by using pixels all over the screen (soon by using a nice picture) and nor just in the place most used).
Because in GUIs activities are more evenly spread over the screen in most cases (and of course better screens) the screen saving function was lost, but replacing what is on the screen by something neutral for security reasons became the main goal. Locking the screen at the same moment is then only a tiny step further.
This “screen saving” and locking was still done after the user had no activity for some time, reasoning that (s)he walked away and thus the screen was vulnarable to be seen by walkers by (and without the locking even vulnarable to tinkering).

Then (or at the same time) it became clear that the userr doing no keyboard hits and not using the mouse for some time could still be busy looking at the screen, some download ruler goinf to 100% or movies! I belong tho the generation that had to move the mouse or hit the Shift key every so many minutes to leave the screen alive.

This is solved (probably by the appications telling the underlying DE or Windows Manager what it is showing) over time and now you ask how to revert this. :frowning:

It is indeed strange to try to revert the screen locking. Normally people complain that the screen locks when they watch a video, e.g. in a browser.

In Gnome and KDE the screen locker or screensaver will not lock the screen if you watch a video in VLC or mpv etc and that makes sense. If you are not doing anything else it will.
Though you could disable some functionality in VLC, e.g. you can untick the box that disables the screensaver from the advanced options.

You could also disable all screensavers and screen lockers and use DPMS by setting it manually to always lock the screen at one specific time. That will work but is tedious to set up and will interfere with the desktop environment’s own settings, watching videos or doing presentations. It is more used by people that prefer window manager only setups.

There is a nice article on the Arch Wiki about DPMS settings.

https://wiki.archlinux.org/index.php/Display_Power_Management_Signaling