ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] Запуск иксовой программы через cron или at
@ 2005-12-13 18:55 Sergey Lizogub
  2005-12-13 19:05 ` Damir Shayhutdinov
  0 siblings, 1 reply; 5+ messages in thread
From: Sergey Lizogub @ 2005-12-13 18:55 UTC (permalink / raw)
  To: Community Altlinux

	Как заставить cron или at запускать иксовую программу  если
иксы загружены (на tty7)?
	При попытке получаю письмо со словами::

	Error: Can't open display: 

	С уважением,
	Сергей Лизогуб


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Comm] Запуск иксовой программы через cron или at
  2005-12-13 18:55 [Comm] Запуск иксовой программы через cron или at Sergey Lizogub
@ 2005-12-13 19:05 ` Damir Shayhutdinov
  2005-12-13 19:26   ` Sergey Lizogub
  0 siblings, 1 reply; 5+ messages in thread
From: Damir Shayhutdinov @ 2005-12-13 19:05 UTC (permalink / raw)
  To: ALT Linux Community

13.12.05, Sergey Lizogub<linthong@mail.ru> написал(а):
>         Как заставить cron или at запускать иксовую программу  если
> иксы загружены (на tty7)?
>         При попытке получаю письмо со словами::
>
>         Error: Can't open display:
>
Установить нужное значение переменной DISPLAY перед запуском иксовой программы.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Comm] Запуск иксовой программы через cron или at
  2005-12-13 19:05 ` Damir Shayhutdinov
@ 2005-12-13 19:26   ` Sergey Lizogub
  2005-12-13 20:46     ` Alex Yustasov
  0 siblings, 1 reply; 5+ messages in thread
From: Sergey Lizogub @ 2005-12-13 19:26 UTC (permalink / raw)
  To: ALT Linux Community

Tue, 13 Dec 2005 22:05:01 +0300
Damir Shayhutdinov:

> 13.12.05, Sergey Lizogub<linthong@mail.ru> написал(а):
> >         Как заставить cron или at запускать иксовую программу  если
> > иксы загружены (на tty7)?
> >         При попытке получаю письмо со словами::
> >
> >         Error: Can't open display:
> >
> Установить нужное значение переменной DISPLAY перед запуском иксовой
> программы.

	А как?

	Сергей Лизогуб


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Comm] Запуск иксовой программы через cron или at
  2005-12-13 19:26   ` Sergey Lizogub
@ 2005-12-13 20:46     ` Alex Yustasov
  2005-12-14  7:40       ` Alex Yustasov
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Yustasov @ 2005-12-13 20:46 UTC (permalink / raw)
  To: ALT Linux Community

On Tue, Dec 13, 2005 at 10:26:21PM +0300, Sergey Lizogub wrote:
> Tue, 13 Dec 2005 22:05:01 +0300
> Damir Shayhutdinov:
> 
> > 13.12.05, Sergey Lizogub<linthong@mail.ru> написал(а):
> > >         Как заставить cron или at запускать иксовую программу  если
> > > иксы загружены (на tty7)?
> > >         При попытке получаю письмо со словами::
> > >
> > >         Error: Can't open display:
> > >
> > Установить нужное значение переменной DISPLAY перед запуском иксовой
> > программы.
> 
> 	А как?
$ DISPLAY=:0.0 <команда>

-- 
    Alex Yustasov


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Comm] Запуск иксовой программы через cron или at
  2005-12-13 20:46     ` Alex Yustasov
@ 2005-12-14  7:40       ` Alex Yustasov
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Yustasov @ 2005-12-14  7:40 UTC (permalink / raw)
  To: ALT Linux Community

On Tue, Dec 13, 2005 at 10:46:28PM +0200, Alex Yustasov wrote:
> On Tue, Dec 13, 2005 at 10:26:21PM +0300, Sergey Lizogub wrote:
> > Tue, 13 Dec 2005 22:05:01 +0300
> > Damir Shayhutdinov:
> > 
> > > 13.12.05, Sergey Lizogub<linthong@mail.ru> написал(а):
> > > >         Как заставить cron или at запускать иксовую программу  если
> > > > иксы загружены (на tty7)?
> > > >         При попытке получаю письмо со словами::
> > > >
> > > >         Error: Can't open display:
> > > >
> > > Установить нужное значение переменной DISPLAY перед запуском иксовой
> > > программы.
> > 
> > 	А как?
> $ DISPLAY=:0.0 <команда>

Для at скорее всего будет работать.
В hibernate вызывается xscreensaver-command -lock, для вызова из acpid

#!/bin/bash

    for xpid in `pidof xscreensaver` ; do
	xuser=`awk 'BEGIN{RS="\\000";FS="="}($1 == "USER"){print $2}' < /proc/$xpid/environ`
	xdisp=`awk 'BEGIN{RS="\\000";FS="="}($1 == "DISPLAY"){print $2}' < /proc/$xpid/environ`
	xauth=`awk 'BEGIN{RS="\\000";FS="="}($1 == "XAUTHORITY"){print $2}' < /proc/$xpid/environ`
	if [ -z "$xauth" ] ; then
	    xhome=`awk 'BEGIN{RS="\\000";FS="="}($1 == "HOME"){print $2}' < /proc/$xpid/environ`
	    xauth="$xhome/.Xauthority"
	fi

    done
    DISPLAY=$xdisp XAUTHORITY=$xauth su $xuser -c "xscreensaver-command -lock"

Может еще нужно указывать XAUTHORITY и запускать из под пользователя.
Искать окружение можно по менеджеру например, если нет xscreensaver.

-- 
    Alex Yustasov


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-12-14  7:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-13 18:55 [Comm] Запуск иксовой программы через cron или at Sergey Lizogub
2005-12-13 19:05 ` Damir Shayhutdinov
2005-12-13 19:26   ` Sergey Lizogub
2005-12-13 20:46     ` Alex Yustasov
2005-12-14  7:40       ` Alex Yustasov

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/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 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

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


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