Techniques for a boot or cron script to find and interact with a GUI user?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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!
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.