LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 03-29-2010, 11:56 AM   #1
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,528
Blog Entries: 27

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
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
 
Old 03-29-2010, 12:43 PM   #2
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-19-live-usb/ aix
Posts: 3,841

Rep: Reputation: 590Reputation: 590Reputation: 590Reputation: 590Reputation: 590Reputation: 590
does this help:
http://www.linuxquestions.org/questi...0/#post1861245
 
1 members found this post helpful.
Old 03-29-2010, 01:32 PM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,528
Blog Entries: 27

Original Poster
Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by schneidz View Post
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.
 
Old 03-30-2010, 06:33 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,528
Blog Entries: 27

Original Poster
Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
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.
 
  


Reply

Tags
boot, cron, dialog, script, xdialog, zenity


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/etc/cron.daily/find script sulekha Ubuntu 1 11-09-2008 03:06 AM
Find Techniques SBN Linux - General 6 04-05-2008 12:30 AM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
can run script from my user but not with cron beeblequix Linux - Enterprise 2 04-13-2007 10:22 AM
How to interact a script with a legacy DOS app kscott121 Linux - Software 0 11-03-2004 01:45 PM


All times are GMT -5. The time now is 07:27 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration