Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My screenlock is set to five minutes. So while playing YouTube videos after five minutes the screen locks even though the video is playing. Any solutions?

share|improve this question
1  
For full-screen Flash videos your accepted answer of Caffeine is best. For videos in the Movie Player, change the setting Edit/Preferences/Display/Disable screensaver when playing... – Tom Brossman Jun 16 '12 at 5:59
This happens me on gnome, but not on unity. – BullfrogBlues Feb 27 at 15:44
HOWTO: Disable screen saver while Flash is running: askubuntu.com/a/171164/94215 – milkovsky Apr 16 at 13:38
Happens to me on Unity too. – Eduard Luca May 11 at 0:31

7 Answers

In my system (Ubuntu 11.10) i use Caffeine. You can try if it works in Xubuntu too. It adds a notification area icon where you can enable/disable screensaver for some programs. To install Caffeine, do the following:

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

Then execute in a terminal:

caffeine -p &

You can then choose the programs that should disable the screensaver:
vlc for VLC, mplayer for Movie Player, etc.

Caffeine Preferences

Hope it helps.

share|improve this answer
This is running pretty fine on 12.04, Thank you! – Geppettvs D'Constanzo Sep 24 '12 at 19:47
Thanks for contributing a solution, but this is the best solution? Is this not a bug? It's got to be a bug. This happens on gnome, but not on unity. – BullfrogBlues Feb 27 at 15:47
I am now on 12.04 and I still use that application, not to stop the screensaver but to disable decrease of screen brightness quickly. For what I saw if it is a bug, it is in the browser: it should be his responsibility to inhibit the screensaver when in fullscreen. – Salem Mar 3 at 19:00

There is a nice little script on GitHub called lightsOn which should do the trick you want.

Basically it looks for full screen video (flash in firefox or chromium, mplayer or vlc) and if so disable xscreensaver and also the auto power-manager dim screen capability.

from the script itself:

HOW TO USE: Start the script with the number of seconds you want the checks
for fullscreen to be done. Example:
 "./lightsOn.sh 120 &" will Check every 120 seconds if Mplayer,
 VLC, Firefox or Chromium are fullscreen and delay screensaver and Power Management if so.
 You want the number of seconds to be ~10 seconds less than the time it takes
 your screensaver or Power Management to activate.
 If you don't pass an argument, the checks are done every 50 seconds.

Thus call the script from your autostart folder as per my answer here.

Adjust the script for whether you are running flash/vlc/mplayer

remember to give the script execute rights to run i.e.

chmod +x lightsOn.sh
share|improve this answer

You should not only check the screensaver options, but also the power management options, especially the "Put display to sleep when inactive for ..." option.

Note that on laptops, there are two settings with that name: when the laptop is running on AC power and when it is running on battery.

share|improve this answer

The VLC in this PPA in addition to being a current version of VLC also correctly implements screen saver inhibition.

https://launchpad.net/~n-muench/+archive/vlc?field.series_filter=lucid

You can add this PPA using this command

sudo add-apt-repository ppa:n-muench/vlc

share|improve this answer

I've never tried it, but this might work: http://www.upubuntu.com/2011/07/disable-temporarily-ubuntu-screensaver.html

share|improve this answer
1  
Well, I did not want to remove screensaver, I want it to come up when really inactive and just skip it when in full screen mode. Since caffeine allows to add applications and flash videos to temporarily disabling screensaver, that's pretty much what I need most of the times. Thank you! – Neptunno Jun 16 '12 at 3:22

It depends somewhat on what version of Ubuntu you are using. In 11.10, you can find "System Settings" in by clicking the gear icon in the top right corner of the screen. Select this, and in the dialog that pops up, select "Screen". You can set the amount of time that your computer will be idle before the screen blanks with the dropdown menu, or disable that feature by clicking the button labeled "Lock".

-screenshot not posted due to lack of reputation-

If you have an older system, you may have to look elsewhere for this setting, but it is there somewhere.

share|improve this answer
1  
Yeah, but I do not want to disable it permanently. – Ubuntu_kwr Feb 20 '12 at 10:38

For those that like full or manual control at their hands

This command line can set the screensaver delay time:
gsettings set org.gnome.settings-daemon.plugins.power sleep-display-ac 0

Use "0" (zero) to keep it on or another value to define the delay in seconds.

The following script will keep the screen on until some key is pressed.

#!/bin/bash

# 
# To turn screen sleep time off for a while then back on
#
# by desgua 2013/01/27
#

# Getting the previous configuration
back=$(gsettings get org.gnome.settings-daemon.plugins.power sleep-display-ac)

# Defining the restore function
function RESTORE {

gsettings set org.gnome.settings-daemon.plugins.power sleep-display-ac $back
gsettings set org.gnome.settings-daemon.plugins.power sleep-display-battery $back
gsettings set org.gnome.desktop.session idle-delay $back

bmin=$(echo "$back / 60" | bc)
#notify-send "Screen sleep time restored to $bmin minutes."
echo
echo "Screen sleep time restored to $bmin minutes."
echo 

exit 0
}

# Making sure the user don't mess up...
trap 'RESTORE && exit 0' INT HUP

# Disabling sleep time
gsettings set org.gnome.settings-daemon.plugins.power sleep-display-ac 0
gsettings set org.gnome.settings-daemon.plugins.power sleep-display-battery 0
gsettings set org.gnome.desktop.session idle-delay 0

echo
echo "Screen sleep time turned off."
echo 

#notify-send "Screen sleep time turned off."

# Waiting for user to press some key and then restore the previous configuration
read -n 1 -p 'Press any key to turn it on again. ' b

RESTORE

exit 0

How to run a script:
1. Copy the text into an empty file,
2. Save the file,
3. Make the file executable,
4. Run it from a terminal.

Enjoy ;-)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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