Saratov Linux User Group
 help / color / mirror / Atom feed
From: Sicness <ctolbhuk@gmail.com>
To: Saratov Linux User Group Maillist <sarlug@lists.lug.ru>
Subject: Re: [Sarlug] Определение простоя системы
Date: Fri, 14 Aug 2009 21:44:34 +0400
Message-ID: <4A85A282.4000201@gmail.com> (raw)
In-Reply-To: <921f6bb40908140837u1a97ebe9o16554159876c4cf7@mail.gmail.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> 14 августа 2009 г. 17:49 пользователь Sicness (ctolbhuk@gmail.com) написал:
>> Здравстуйте. Задумался над не тривиальной задачей. Как отловить что
>> система простаивает, всмысле что нет активности пользователя n времени.
>> Я хочу при наступлении этого n запустить музыку, а при первой активности
>> выключить. Как это можно реализовать. В частности, как можно определить
>> простой системы? Сама то ОС знает сколько она простаивает (например
>> выключает монитор). И, собственно, как отловить окончание простоя :)
>> Ubuntu 9.04
> 
Нашел вариант по мне. Команда w показывает время простоя.
> sicness@Atom:~$ for i in `seq 1 10`; do sleep 3; w; done
>  21:43:33 up 11:41,  3 users,  load average: 0,08, 0,27, 0,40
> USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
> sicness  tty7     :0               10:03   11:41m 48:33   1.21s /usr/bin/gnome-session
> sicness  pts/0    :0.0             10:30    3.00s  6.30s  0.03s w
> sicness  pts/2    :0.0             20:14    1:25m  0.28s  0.28s zsh
>  21:43:36 up 11:41,  3 users,  load average: 0,08, 0,27, 0,40
> USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
> sicness  tty7     :0               10:03   11:41m 48:33   1.21s /usr/bin/gnome-session
> sicness  pts/0    :0.0             10:30    6.00s  6.28s  0.01s w
> sicness  pts/2    :0.0             20:14    1:25m  0.28s  0.28s zsh


Её парсить буду :)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iJwEAQECAAYFAkqFooEACgkQ5jgWcLqRXlf6agP/S9sEos/7J4mDuQVJeqEjTkll
1BqhzXm5xmqrjuHzFVJ69cfLjCxLL1ZmXyXaVk4RNmQc3zyutgQrU0oMZdOxXgCr
UrgAW1G9cJBCTMbp0eLs/uhAAVjhgtPj9osuTv6YCBpGWxiS1luf7lPwlZjRpugR
pbny8XysFOG2rCR0uDk=
=Pxgd
-----END PGP SIGNATURE-----


      reply	other threads:[~2009-08-14 17:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-14 13:49 Sicness
2009-08-14 15:37 ` Evgeny Sinelnikov
2009-08-14 17:44   ` Sicness [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A85A282.4000201@gmail.com \
    --to=ctolbhuk@gmail.com \
    --cc=sarlug@lists.lug.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Saratov Linux User Group

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sarlug/0 sarlug/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sarlug sarlug/ http://lore.altlinux.org/sarlug \
		sarlug@lists.lug.ru sarlug@lug.ru
	public-inbox-index sarlug

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sarlug


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git