LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-10-2007, 05:08 PM   #1
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,546

Rep: Reputation: 57
Running crontab cmd for user without knowing Env DISPLAY


Hello,

I set up my crontab for user with Kcron.
That's nice program but I need to setup some X things: xmms in the morning.

So to do so, we need this command line:
Code:
env DISPLAY=:4. xmms -p
with this great Importance : env DISPLAY=:4.

Because of the quantity of users using the machine during the day, the env Display is variable from 0 up to 6. The pc is in my room, to wake me up with xmms the morning. So, is there a way to run the crontab user with this variable DISPLAY.

Thanks

 
Old 07-12-2007, 02:01 AM   #2
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 63
It might work like that: DISPLAY=:4 xmms -p
However it may fail if the display is not :4 at this time but :0 or :1... or if you are not allowed (see xhost).

Yves.
 
Old 07-13-2007, 09:44 AM   #3
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,546

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by theYinYeti
It might work like that: DISPLAY=:4 xmms -p
However it may fail if the display is not :4 at this time but :0 or :1... or if you are not allowed (see xhost).

Yves.
hence if I understand well, I should make a perl code with:
Code:
ps -aux | grep "xinit"
checking where is the DISPLAY then exec cmd this X apps.

hmm
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl: getting %ENV values using su cmd chrism01 Programming 10 05-25-2007 11:11 AM
New User has X Server Running on Display 0 already mythdified Linux - Newbie 17 08-09-2004 05:07 PM
Environment Variable: how to change env DISPLAY in Redhat 9 lucastic Linux - General 2 07-21-2004 04:15 PM
How do i re-install or delete a user without knowing the username or password? burnoutKyle Red Hat 4 03-12-2004 02:21 PM
Uninstalling Redhat without knowing the user password DeathMaster1 Linux - General 4 06-20-2002 05:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:51 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration