LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Techniques for a boot or cron script to find and interact with a GUI user? (http://www.linuxquestions.org/questions/programming-9/techniques-for-a-boot-or-cron-script-to-find-and-interact-with-a-gui-user-798685/)

catkin 03-29-2010 12:56 PM

Techniques for a boot or cron script to find and interact with a GUI user?
 
Hello :)

Can a boot script or a script run by crond a) find and b) interact with a GUI interactive user?

Presumably it could look for a process tree headed by xdm, gdm or kdm and, if it could find and access their DISPLAY it could use something like dialog, Xdialog or zenity.

Any giants around? I'd like to stand on their shoulders!

Best

Charles

schneidz 03-29-2010 01:43 PM

does this help:
http://www.linuxquestions.org/questi...0/#post1861245

catkin 03-29-2010 02:32 PM

Quote:

Originally Posted by schneidz (Post 3916990)

Thanks schneidz :) Yes that helps; I'll explore it soon. The xhost +localhost looks like an essential component in putting it together. In case there are more goodies in the toolkit, I'll not mark this thread solved yet.

catkin 03-30-2010 07:33 AM

The w command provides a generic way to determine which DISPLAY to use
Code:

c@CW8:~$ w
 16:58:06 up  2:13,  5 users,  load average: 0.06, 0.04, 0.00
USER    TTY      FROM              LOGIN@  IDLE  JCPU  PCPU WHAT
[snip]
c        pts/5    :0.0            16:58    0.00s  0.00s  0.00s w

thence from the FROM column, presumably
Code:

export DISPLAY="$( /bin/hostname ):0.0
Will experiment and update.


All times are GMT -5. The time now is 12:37 PM.