elementary locks the screen after about 15 minutes of "inactivity", except the activity I'm doing is watching videos (no keyboard or mouse inputs during that lapse).

Site in question is Crunchyroll (uses flash plugin) running on Chromium in fullscreen mode on a secondary display (a 720p TV) via HDMI. AdBlock activated.

Behavior: right in the middle of an episode (12 to 15 minutes) the TV screen suddenly goes No Input. Main display (laptop screen) shows Login screen. Upon entering my password, video resumes.

My workaround to this is that I randomly move the mouse from time to time.

Should I do anything special to prevent screen/session locking?


4 Answers 4



There is a litte bash script called lightsOn on GitHub, which automatically checks on various apps, including fullscreen Flash and html5 video. (It works for me.)

Bash script managing screensaver and display power management (DPMS) on different conditions (fullscreen videos, specific applications, specific outputs).

To use the program save the file lightsOn.sh in your home directory, make it executable by typing chmod +x ~/lightsOn.sh and run it ~/lightsOn.sh 300 (this will check every 300 seconds = 5 minutes).

If it works you can add the script to startup by adding ~/lightsOn.sh 300 in System Settings > Applications > Startup.

The script detects a variety of apps / usages, you can configure (among other options) detecting certain things right in the shell script:

# Modify these variables if you want this script to detect if MPV, Mplayer,
# VLC, Minitube, Totem or a web browser Flash/HTML5 Video.

Try to use Caffeine.

A status bar application able to temporarily prevent the activation of both the screensaver and the "sleep" powersaving mode.


sudo add-apt-repository ppa:caffeine-developers/ppa 
sudo apt-get update
sudo apt-get install caffeine

EDIT: Currently, this method doesn't work on Freya.

  • Thank you @PNG I installed, but I don't know how to "manage" it. I mean, it's in my Applications menu, and when I click on its icon it seems like it starts, but I can't see whether it's running or not. How can I enable/disable it?
    – Jorge
    Commented Jul 29, 2015 at 22:27
  • @Jorge, it should work automatically, without user intervention. Simply place it in the autostart.
    – png2378
    Commented Jul 29, 2015 at 22:34
  • @Jorge I experience a bug with this app where I can apparently open it but there's no icon in the Wingpanel for me to manage it (see: bugs.launchpad.net/elementaryos/+bug/1473096). A way around this is to launch caffeine-indicator instead from Slingshot, that should show you the icon in Wingpanel. PNG: that won't work, at least in my case I have to manually tell it to 'Activate' otherwise it does nothing.
    – Gabriel
    Commented Jul 30, 2015 at 14:25
  • Also @Jorge if you see that the bug I pointed you too is the same one that affects you, please mark yourself as accepted and change the status from 'New' to 'Confirmed'. Thanks!
    – Gabriel
    Commented Jul 30, 2015 at 14:26
  • 1
    Sorry, this is really some point stopped working. Installing Caffeine Plus also did not bring results.
    – png2378
    Commented Jul 30, 2015 at 19:47

The following commands do the job of using lightsOn :

mkdir -p ~/scripts && cd ~/scripts
wget https://raw.github.com/hotice/lightsOn/master/lightsOn.sh
chmod +x lightsOn.sh

By default, the script works with Firefox and Chromium, but you can also enable it for VLC or mplayer. To do this, open the "lightsOn.sh" file and modify the "mplayer_detection" and/or "vlc_detection" from 0 to 1.

To run the script: Open terminal and run-


To get the script to run each time your computer starts, you can add it to the startup applications.

Reference here


The best way I found it for every Linux system is:

  • Open VLC
  • Play and pause any video you have
  • Reduce to icon
  • Then you can view every streaming video without start the screensaver

This is the best way and more simple instead use some useless scripts.

This feature need to come with browsers and not with additional scripts/apps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.