Using crontab to control Totem media player

I want totem to be paused automatically every night so it doesn’t keep playing the whole night.

What I had in my crontab was:

40 20 * * * /usr/bin/totem –pause

However, totem wouldn’t pause and MAILTO was sending me this error:

Cannot open display: 
Run '/usr/bin/totem --help' to see a full list of available command line options.

After a lot of searching, I found a post at Ubuntuforums.org that solved the problem by providing the display:

40 20 * * * env DISPLAY=:0 /usr/bin/totem –pause

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s