Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Automatically close application after custom time?

I want to stop/kill my totem player after a specific amount of time. Can it be done?

share|improve this question

marked as duplicate by RolandiXor, Nitin Venkatesh, Jorge Castro, con-f-use, ajmitch Aug 22 '12 at 3:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 3 down vote accepted

It can be done with a simple command. Once Totem is running, open up the terminal and enter the following line:

$ sleep n && totem --quit

Where n is the number of seconds you want to have elapsed before Totem is closed.

Explanation of the command

This is a very simple command, and if you want to learn more about using the terminal you should consider reading a bash tutorial, like this one.

The sleep n command waits until n seconds have elapsed and then the next command can be run.

Writing && after it tells the terminal to run another command as soon as the previous is finished, which is why I have written totem --quit after it.

You can do many more actions and not just quitting. Many applications in linux have a command line interface, which allow you to do this. To see what actions you can do on them through their interface, it is a good idea to check its manual, by running in a terminal $ man <application>; or help text, which is usually shown by running in a terminal $ <application> --help.

share|improve this answer
Totem was just an example. If I replace totem with the application name, will that work? – harisibrahimkv May 3 '12 at 16:41
I have updated the answer to explain this, but yes - as I wrote - any command after the && will do. If the application didn't have a command line interface, you could write killall <application> instead of totem --quit. – Severo Raz May 3 '12 at 16:50

I've found an alternative answer with another command.

Step 1. Find the process id.

haris@asylum:~$ ps -e | grep totem
7315 ?        00:00:30 totem

Step 2. Give the time at which to kill it.

haris@asylum:~$ at 11.30pm
warning: commands will be executed using /bin/sh
at> kill 7315
at> <EOT>
job 8 at Sun Oct  2 07:30:00 2011

Where EOT refers to Control+d.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.