Re: System idle time under Linux

2010-09-30 Thread Hugo Léveillé
Ok after some testing, what the who -Hu is giving me is the idle time of each running open shell. The first line always return a "?" as the IDLE time. ex: NAME LINE TIME IDLE PID COMMENT vg0619hl :0 2010-09-30 06:10 ? 13091 vg0619hl pts/1

Re: System idle time under Linux

2010-09-30 Thread John Pinner
On Sep 29, 7:36 pm, Hugo Léveillé wrote: > Good point > > One I am looking for, is time since last user mouse or keyboard action. > So I guess I am looking for the exact same thing a screensaver is > looking for The command who -Hu). will give you idle time for each logged-in user ( H - print

Re: System idle time under Linux

2010-09-30 Thread Ifrit
Ifrit heeft het volgende neergekrabbeld: > Hugo Léveillé heeft het volgende neergekrabbeld: > >> >> Thanks, will take a closer look on that >> >> But to get me started, how would you get, via python, the info from that > > From a unix command prompt use the cat command to view their contents.

Re: System idle time under Linux

2010-09-30 Thread Ifrit
Hugo Léveillé heeft het volgende neergekrabbeld: > > Thanks, will take a closer look on that > > But to get me started, how would you get, via python, the info from that From a unix command prompt use the cat command to view their contents. You'll notice that they plain text files with very in

Re: System idle time under Linux

2010-09-30 Thread Lawrence D'Oliveiro
In message , Hugo Léveillé wrote: > Sorry, I am not a linux guy. Did not know it was a text file That’s why I said to check the proc(5) man page for further details. -- http://mail.python.org/mailman/listinfo/python-list

Re: System idle time under Linux

2010-09-29 Thread Grant Edwards
On 2010-09-29, Hugo L?veill? wrote: > One I am looking for, is time since last user mouse or keyboard action. > So I guess I am looking for the exact same thing a screensaver is > looking for Oh. That's not what "idle" generally means in a Unix/Linux context, so you can disregard previous answe

Re: System idle time under Linux

2010-09-29 Thread Seebs
On 2010-09-29, Hugo L?veill? wrote: > One I am looking for, is time since last user mouse or keyboard action. > So I guess I am looking for the exact same thing a screensaver is > looking for You can probably get it from X somehow, but... Basically, be aware that it is entirely possible for a Lin

Re: System idle time under Linux

2010-09-29 Thread Hugo Léveillé
Good point One I am looking for, is time since last user mouse or keyboard action. So I guess I am looking for the exact same thing a screensaver is looking for On Wed, 29 Sep 2010 17:27 +, "Seebs" wrote: > On 2010-09-29, Hugo L?veill? wrote: > > I have found it for windows and mac, but n

Re: System idle time under Linux

2010-09-29 Thread Seebs
On 2010-09-29, Hugo L?veill? wrote: > I have found it for windows and mac, but no luck under linux. Any idea? I don't think it's semantically well-defined. What makes a system "idle"? Is the machine in my basement idle? I don't think anyone's touched the keyboard in a week, but it's spent a bi

Re: System idle time under Linux

2010-09-29 Thread Grant Edwards
On 2010-09-29, Hugo L?veill? wrote: > Sorry, I am not a linux guy. Did not know it was a text file And the "file" command (the usual way to figure that out) doesn't appear to be helpful: $ file /etc/passwd /etc/passwd: ASCII text [That's helpful] $ file /proc/stat /proc/stat: empty

Re: System idle time under Linux

2010-09-29 Thread Hugo Léveillé
Sorry, I am not a linux guy. Did not know it was a text file On Wed, 29 Sep 2010 14:48 +, "Grant Edwards" wrote: > On 2010-09-29, Hugo L?veill? wrote: > > > > Thanks, will take a closer look on that > > > > But to get me started, how would you get, via python, the info from that? > > Good

Re: System idle time under Linux

2010-09-29 Thread Thomas Jollans
On Wednesday 29 September 2010, it occurred to Hugo Léveillé to exclaim: > Thanks, will take a closer look on that > > But to get me started, how would you get, via python, the info from that > ? Parse the files. They may be very special files, but they are just files. > > Thanks alot > > > O

Re: System idle time under Linux

2010-09-29 Thread Grant Edwards
On 2010-09-29, Hugo L?veill? wrote: > > Thanks, will take a closer look on that > > But to get me started, how would you get, via python, the info from that? Good grief. They're text files. You open them, you read them, you parse the contents for the stuff you want. -- Grant Edwards

Re: System idle time under Linux

2010-09-29 Thread Hugo Léveillé
Thanks, will take a closer look on that But to get me started, how would you get, via python, the info from that ? Thanks alot On Thu, 30 Sep 2010 02:01 +1300, "Lawrence D'Oliveiro" wrote: > /proc/stat or /proc/uptime, depending. See the proc(5) man page. > -- > http://mail.python.org/mailma

System idle time under Linux

2010-09-29 Thread Hugo Léveillé
I have found it for windows and mac, but no luck under linux. Any idea? Thanks -- Hugo Léveillé hu...@fastmail.net -- http://mail.python.org/mailman/listinfo/python-list