Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have set it to "suspend when inactive" after 30 minutes.

How does it determine whether it is inactive? Is it just user input via keyboard/mouse?

If I leave a program working away - say processing a video, which takes a long time, will it suspend after 30 minutes and stop that program? Same question for long downloads, will it suspend halfway through.

share|improve this question
    
Have a search for wake up calls. –  Rinzwind Jul 31 '12 at 8:55
    
In Askubuntu? I just tried it and all the answers seem to pertain to waking the system from suspend or similar. –  Jazz Jul 31 '12 at 22:04

1 Answer 1

up vote 8 down vote accepted

Good question. Let's find out!

  1. Beginning by investigating the "Suspend when inactive for" option in System Settings, we can learn that it sets a GSettings key in org.gnome.settings-daemon.plugins.power called sleep-inactive-ac-timeout. The documentation for this key provides a brief description:

    The amount of time in seconds the computer on AC power needs to be inactive before it goes to sleep. A value of 0 means never.

    but still doesn't explain what "inactive" means.

  2. Searching for sleep-inactive-ac-timeout reveals that GNOME Settings Daemon uses its value to periodically check a property of GNOME Session called org.gnome.SessionManager.Presence.status. When GNOME Settings Daemon finds that the status is "idle," it puts the system to sleep.

    So, we need to learn how GNOME Session decides whether the system is "idle."

  3. GNOME Session updates the value of org.gnome.SessionManager.Presence.status based on the IDLETIME counter in Xorg. Its behavior is explained in this blog post by the author of GNOME Power Manager. The part we care about is this:

    gnome-power-manager uses a counter inside Xorg called IDLETIME. This counter is incremented only when the user does not move the mouse, or click some keys. When the user clicks something, the IDLECOUNTER is reset.

This tells us that Ubuntu determines inactivity by measuring the amount of time that has passed since the last keystroke or mouse motion. CPU usage and network activity do not factor in.

share|improve this answer
    
as you said in last line why The CPU usage not considerable ? My doubt is i came from askubuntu.com/questions/215870/… . because if i put download of 1GB file then it can take a lot of time . even I am afk My PC still doing download of that file right . That means my PC active right ? :D –  AgentCool Nov 22 '12 at 13:12

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.