You are not logged in.

#1 2008-01-04 07:12:28

colbert
Member
Registered: 2007-12-16
Posts: 809

cannot get amarok to play with cron

I used to have this in Ubuntu, I use gnome-schedule GUI for cron and have some other cronjobs working fine. But amarok will not play (I like to use it as a wake-up alarm). I have:

15 7 * * * export DISPLAY=:0 && amarok -t

But it doesn't work. I've tried "amarok -t" in quotes, no go. When I hit amarok -t in a terminal it play/pauses fine. hmm

Offline

#2 2008-01-04 12:34:17

MAC!EK
Member
Registered: 2005-09-27
Posts: 267

Re: cannot get amarok to play with cron

cron is trying to run amarok as root so it mayby could not get to Xsession running from different user?
Check logfile /var/log/crond and /var/log/Xorg.0.log

Mayby set up local connections to allow:
/etc/X0.hosts:

local:

Now root can display X11 apps on Xsession run by different user.


PS:
You can also try running amarok as your normal user using sudo:
sudo -u YOUR_USER DISPLAY=:0 amarok -t

or smth like:
su - USER --command="amarok -t"


There's also an amarok script call smth like "wake up", you can set up time when amarok should start playing.

Last edited by MAC!EK (2008-01-04 12:41:13)

Offline

#3 2008-01-04 19:22:29

colbert
Member
Registered: 2007-12-16
Posts: 809

Re: cannot get amarok to play with cron

This is from my testing the cronjob last night, from /var/log/crond:

04-Jan-2008 02:01  FILE /var/spool/cron/root USER root pid 32494 cmd /usr/sbin/run-cron /etc/cron.hourly
04-Jan-2008 02:02  FILE /var/spool/cron/bobby USER bobby pid 32635 cmd export DISPLAY=:0 && amarok -t >/dev/null 2>&1 #JOB_ID_2
04-Jan-2008 02:03  FILE /var/spool/cron/bobby USER bobby pid 309 cmd amarok -t >/dev/null 2>&1 #JOB_ID_2
04-Jan-2008 02:04  FILE /var/spool/cron/bobby USER bobby pid 461 cmd export DISPLAY=:0 & amarok -t >/dev/null 2>&1 #JOB_ID_2
04-Jan-2008 02:05  FILE /var/spool/cron/bobby USER bobby pid 647 cmd export DISPLAY=:0 && "amarok -t" >/dev/null 2>&1 #JOB_ID_2
04-Jan-2008 02:08  FILE /var/spool/cron/bobby USER bobby pid 1087 cmd export DISPLAY=:0 && amarok -p >/dev/null 2>&1 #JOB_ID_2
04-Jan-2008 02:12  FILE /var/spool/cron/bobby USER bobby pid 1612 cmd export DISPLAY=:0 && 'amarok -t' >/dev/null 2>&1 #JOB_ID_2
04-Jan-2008 02:13  FILE /var/spool/cron/bobby USER bobby pid 1749 cmd export DISPLAY=:0 && wxvlc >/dev/null 2>&1 #JOB_ID_2
04-Jan-2008 02:14  FILE /var/spool/cron/bobby USER bobby pid 1879 cmd export DISPLAY=:0 && amarokapp -t >/dev/null 2>&1 #JOB_ID_2
04-Jan-2008 02:16  FILE /var/spool/cron/bobby USER bobby pid 2155 cmd export DISPLAY=:0 && /opt/kde/bin/amarok -t >/dev/null 2>&1 #JOB_ID_2

I don't understand how it can be a permission/user issue, as I tested cron with other apps like vlc, xine, openoffice, etc. and they all run as scheduled ??

Offline

#4 2008-01-04 19:33:07

MAC!EK
Member
Registered: 2005-09-27
Posts: 267

Re: cannot get amarok to play with cron

remove ">/dev/null 2>&1 " and you will see what's wrong, a better way to set DISPLAY variable is:

DISPLAY=:0 /opt/kde/bin/amarok -t

no need to export

Last edited by MAC!EK (2008-01-04 19:34:09)

Offline

#5 2008-01-04 19:40:59

colbert
Member
Registered: 2007-12-16
Posts: 809

Re: cannot get amarok to play with cron

Okay, I just used that and this popped up:

error.jpg

(And amarok is running)

EDIT: And I just added /opt/kde/bin to /etc/profile in path. Same thing.

Last edited by colbert (2008-01-04 19:45:27)

Offline

#6 2008-01-04 19:49:19

MAC!EK
Member
Registered: 2005-09-27
Posts: 267

Re: cannot get amarok to play with cron

mayby try /opt/kde/bin/amarokapp -t?

Offline

#7 2008-01-04 19:53:08

colbert
Member
Registered: 2007-12-16
Posts: 809

Re: cannot get amarok to play with cron

Okay, that works, but it starts up another amarok. Doggonit!

Offline

#8 2008-01-04 20:05:34

MAC!EK
Member
Registered: 2005-09-27
Posts: 267

Re: cannot get amarok to play with cron

OMG... so you have amarok running all the time?!
Use "weekalarm" script for amarok:
http://www.kde-apps.org/content/show.ph … tent=23160

Offline

#9 2008-01-04 20:42:58

colbert
Member
Registered: 2007-12-16
Posts: 809

Re: cannot get amarok to play with cron

Yeah, I had already tried that and when I hit Run in the amarok script manager I keep getting this:

error2.jpg

Offline

#10 2008-01-04 20:49:34

MAC!EK
Member
Registered: 2005-09-27
Posts: 267

Re: cannot get amarok to play with cron

Hmmm same here..
no more ideas neutral

Offline

#11 2008-01-04 21:00:35

May-C
Member
Registered: 2007-12-28
Posts: 83

Re: cannot get amarok to play with cron

Maybe DCOP is a possibility ?

Offline

#12 2008-01-04 21:01:13

Wilson Phillips
Member
From: Vicksburg, MS, USA
Registered: 2007-09-24
Posts: 70

Re: cannot get amarok to play with cron

I have not attempted this and I am nowhere near my PC to try it, but since amarok is already running, why not just call a media file or a playlist and see what that does.


Guarantee does not cover shark bite, bear attack, or children under 5.

Offline

#13 2008-01-04 21:20:23

colbert
Member
Registered: 2007-12-16
Posts: 809

Re: cannot get amarok to play with cron

Solved! Pyqt was missing. Installed it and now she runs smile smile

Offline

Board footer

Powered by FluxBB