I discover that command xset dpms 300 which turn off the screen for example after 5 minutes (300s), and it wonderfully doesn't turn off the screen if a youtube video is actually playing even in a background window.

However sometimes I want to keep a video playing on the background while not using the computer, so I can manually lock the computer with a custom script (I'm using i3) that will also turn off the screen (with xset s activate).

However if a keyboard (or mouse) event happen the screen will turn on again and then never go back since the video..

Is it possible to have the timeout to be applied regardless of media context as long as the computer is locked?

1 Answer 1


Your video player is probably using session DBus (documentation for GNOME) or the xdg-screensaver utility to inhibit the screensaver while the video player is active. See if your video player has an option to make it not do that.

That should remove the need to force the screensaver.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .