On Friday 22 August 2008 18:20:26 Neil wrote:
On 8/22/08, Ian
wrote: On Thursday 21 August 2008 23:23:28 Neil wrote:
On 8/20/08, Ian
wrote: Hi, I'm trying to find a way to get opensuse to suspend when no-one is logged in. Both gnome & kde provide front ends to pm-utils that can suspend a machine after a period of inactivity, but in my case, we have several computers that are used by numerous people that come and go 24 hours a day, 7 days a week & we'd like the machines to suspend if they aren't in use for a while (meaning there is no-one logged in & the computer is sitting at the GDM screen).
Does anyone here have any idea how we might achieve that? (Or some other mailing list that might be a better place to ask this question?)
Hi.
I do not have the answer in full, but it may be solved by a script. Something like: <pseudo code>
if(#users=0 && idletime=600s) s2ram endif
Insert a working version of this into the crontab and I guess you would solve this
Could someone create a working version of of this?
This requires at least that the number of users that is currently logged in to be available
Neil
(yeah I do know this isn't really a solution, but no-one replied for a day, so I thought I might get the right people to look at it) (hmm, decent scripting should be the next thing I learn. Buying the Bash Cookbook would be a good start?)
Thanks for the reply Neil. idletime hey? Sounds like it could be the go. I'll have a look at using that & post my results back, unless someone else can come up with a better suggestion.
Cheers,
No, it was pseudocode. It would be how I'd call it, but it may very well be that Linux has it under another name, or hasn't got it it in this form (in that case it may be needed to make a screensaver of it). Pseudcode is a tool to show what you want to do, not a way to do it. It looks like code, and that has the advantage it's easy to read for programmers (or scripters in this case) and isn't to prone to misunderstandings.
A top level in your script may very well look very much like it, but a variable #users may not exist normally. It will probably be quite easy to generate, but I have no clue as to how
Neil
And there was I getting all excited :-) I can write scripts, but I'm no programmer, so I've no idea how to access syscalls etc that might provide the information I need. I've found a mailing list for powersave (powersave-users@forge.novell.com), so I'll try posting there and report back anything useful here for anyone else that might be looking for the same info. (But if anyone here has any ideas, please post them!). Cheers, -- Ian gpg key: http://home.swiftdsl.com.au/~imoore/no-spam.asc