LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 08-25-2011, 11:24 AM   #1
AntoineG
LQ Newbie
 
Registered: Aug 2011
Posts: 4

Rep: Reputation: Disabled
Debian locking when watching fullscreen flash videos (Youtube)


Hello!

I'm running Debian Squeeze on a Gateway EC1803H. Everytime I watch videos in fullscreen on Youtube or on Vimeo, or in any Flash player, after 5 minutes, the screen dim, goes black and the computer lock. So it is pretty annoying because I have to move the mouse every 4 minutes or so, and if I don't, the computer dims out and simply locks.

Now, as a temporary solution, I disabled the lock feature so I don't need to put my password when the screen dims. But this is not a real good solution, as I want to keep my system secure. Also, I delayed the dimming delay to 15 minutes (the average length of a SC2 replay!), but again it is not a real solution.

I know that in Windows, there's an option that prevent the OS from sleeping/screensaving when something is in fullscreen. I'm sure it exists in Debian as well, but I still have to find out where it is. I suspect it might not consider Flash apps in its policies or something like that. I searched on Google for similar problems and haven't seen it yet.

I'm on Adobe Flash Player 10.3.183.5 with Google Chrome 13.0.782.112.

uname -a gives:
Linux antoine-netbook 2.6.32-5-686 #1 SMP Mon Jun 13 04:13:06 UTC 2011 i686 GNU/Linux

Quote:
Originally Posted by http://www.silentpcreview.com/Gateway_EC1803h_notebook
CPU
Intel Core 2 Solo SU3500
(1.40GHz, 3MB L2, 5.5W)
Chipset
Intel GS45 Express (ICH9M-E
Graphics
Integrated Intel GMA 4500MHD
Memory
3GB DDR2 (dual channel)
Storage
250GB 5400RPM HDD

Last edited by AntoineG; 08-25-2011 at 11:31 AM.
 
Old 08-26-2011, 01:48 PM   #2
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid/RPIOS
Posts: 4,916
Blog Entries: 29

Rep: Reputation: 540Reputation: 540Reputation: 540Reputation: 540Reputation: 540Reputation: 540
Does it happen with other browsers?

No issues here on my ancient Thinkpad R40
Google Chrome 13.0.782.215 (Official Build 97094)
Shockwave Flash 10.3 r183

Or in Firefox 6
apt-cache policy flashplayer-mozilla
flashplayer-mozilla:
Installed: 2:10.3.183.5-0.0
Candidate: 2:10.3.183.5-0.0
 
Old 08-26-2011, 04:28 PM   #3
BertM
LQ Newbie
 
Registered: Jan 2010
Location: Belgium
Distribution: Debian
Posts: 17

Rep: Reputation: 0
I have the same issue and couldn't quickly find relevant information on the internet, so I hacked up a small Bash script.

It generates fake keyboard input, and more specifically a "left Shift", after the amount of time you specify.

This amount of time you specify, should be the amount of time it takes your computer to put the monitor to sleep/dim it. It will fake the keyboard input 5 seconds before your monitor is put to sleep/dimmed.

Run it in a terminal as follows:

Usage:
./dont_sleep.sh [-s timeinseconds]
./dont_sleep.sh [-m timeinminutes]
Values in seconds must be integers and higher than 5.
Values in minutes must be integers and at least 1.

To stop it, just press Ctrl+C or kill the process in some other way.

To make it even more usefull, use it in conjunction with timeout; this enables you to specify how long the script should run. It's automatically terminated afterwards.

timeout 50m ./dont_sleep.sh -m 5
timeout 2h ./dont_sleep.sh -m 5

Check man timeout.


Code:
#!/bin/bash
#
# This program takes one argument: the amount of time your computer takes before it puts the monitor to sleep (in seconds or minutes).
# It will press the left shift key for you before it happens.
# If you have dimming enabled and want to prevent that, enter the time it takes to dim the monitor.

function usage(){
    echo "Usage: ./dont_sleep.sh [-s timeinseconds]"
    echo "       ./dont_sleep.sh [-m timeinminutes]"
    echo "Values in seconds must be integers and higher than 5."
    echo "Values in minutes must be integers and at least 1."
    exit 0
}

if [ "$#" -ne 2 ] || ! [[ "$1" =~ -{1}. ]]; then
    usage
fi

while getopts ":s:m:" opt; do
    case $opt in
        s)  if  ! [[ "$OPTARG" =~ ^[0-9]+$ ]] || [ "$OPTARG" -lt 5 ]; then
                usage
            fi
            secs=$OPTARG
            ;;

        m)  if  ! [[ "$OPTARG" =~ ^[0-9]+$ ]] || [ "$OPTARG" -lt 5 ]; then
                usage 
            fi
            mins=$OPTARG
            ;;

        ?)  usage
            ;;
    esac
done

if [ "$mins" ]; then
    time=$(((60*$mins)-5)) 
elif [ "$secs" ]; then
    time=$(($secs-5))
fi

echo "Will press left Shift every $time seconds."

while [ true ] 
do
    sleep $time
    # Switch the comment between the next 2 lines if you prefer the mouse is moved instead.
    # Check the manpage for xte for more ideas.
    #xte 'mousermove 1 1'
    xte 'key Shift_L' 
done
PS. I'm not saying this is the best way to do it, feel free to improve.
 
Old 09-03-2011, 11:03 AM   #4
AntoineG
LQ Newbie
 
Registered: Aug 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks for your answers! Unfortunately, I couldn't read them before now, and the computer returned to its owner since then.

I see a lot of bash scripting in Linux, and I know I could find plenty of tutorial online to learn this language, but does any of you have a specific tutorial you would recommend me?
 
Old 09-08-2011, 06:31 AM   #5
BertM
LQ Newbie
 
Registered: Jan 2010
Location: Belgium
Distribution: Debian
Posts: 17

Rep: Reputation: 0
For starting out, I recommend you choose a guide which style matches your taste.

But since you asked for an example, this one seems like a good one to start with:
http://steve-parker.org/sh/sh.shtml

When you are done with that and want to get deeper into bash scripting, I highly recommend the Advanced Bash-Scripting Guide, which you can find in multiple viewing formats here:
http://tldp.org/guides.html

Enjoy.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Do you have to use flash player to play youtube videos? ilikelinux55 Linux - Newbie 15 05-20-2010 08:48 AM
Flash videos from youtube will not play in totem (they're supposed to be able to) Stevithen Debian 3 04-24-2010 04:35 PM
Flashplayer 10 crashes firefox when I try to watch youtube videos fullscreen Slacker Steve Slackware 18 12-21-2008 01:22 AM
CPU runs at 100% when watching videos on YouTube. pollonica Linux - General 2 05-19-2008 10:35 PM
LXer: Saving YouTube Flash Videos LXer Syndicated Linux News 0 03-17-2008 08:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 03:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration