PDA

View Full Version : [ubuntu] Run command at interval



mjheagle8
February 22nd, 2009, 02:06 AM
i'm trying to run a command every 15 seconds.
the command is
pkill feh&&feh -g 70x70 $(dcop amarok player coverImage)&
which is intended to display the current amarok album art in a small box.
i tried
watch -n 15 'pkill feh&&feh -g 70x70 $(dcop amarok player coverImage)&'
that'll launch the one feh, but wont kill and restart it every 15 seconds as i specified. what am i doing wrong? or is there an easier way to accomplish my goal?

thanks in advance for any and all help.

ibuclaw
February 22nd, 2009, 02:53 AM
There is an alarm-applet for Gnome that, as far as I'm aware, is capable of running commands at repetitive intervals: https://launchpad.net/~joh/+archive/ppa

Else, you could always put what you are doing in a script and include it in a your crontab.

Ensure that you include:

DISPLAY=:0
though, else the cron won't appear to work.

Regards
Iain

llamabr
February 22nd, 2009, 03:52 AM
This is untested by me, but I think your:

feh&&feh

Should read:

feh && feh

In order for bash to read the &&'s, it will need the space between the feh commands.

hope it helps.