1 |
"Andrey Falko" <ma3oxuct@×××××.com> writes: |
2 |
|
3 |
> How about something like this: retval=`ps aux | grep tty | grep X | awk |
4 |
> '{print $2}'` |
5 |
> |
6 |
> Or retval=`cat /tmp/.X0-lock` |
7 |
> |
8 |
> Or even better: |
9 |
> |
10 |
> if [[ -e "/tmp/.X0-lock" ]];then |
11 |
|
12 |
Yup, both of those should work from cron or anywhere. In my case and |
13 |
probably many other as well, I could shorten the ps approach to: |
14 |
ps aux|grep '[X] :0' |
15 |
|
16 |
But looking for /tmp/.X0-lock is probably the most reliable. Thanks |
17 |
|
18 |
-- |
19 |
gentoo-user@g.o mailing list |