LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Running crontab cmd for user without knowing Env DISPLAY (https://www.linuxquestions.org/questions/linux-general-1/running-crontab-cmd-for-user-without-knowing-env-display-568227/)

frenchn00b 07-10-2007 05:08 PM

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

:newbie: :newbie: :newbie: :newbie: :newbie:

theYinYeti 07-12-2007 02:01 AM

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.

frenchn00b 07-13-2007 09:44 AM

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:scratch:


All times are GMT -5. The time now is 08:53 PM.