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

Is it possible to set a timer for a running application and save that data somewhere global?

I am doing some volunteer work in an internet cafe where kids are the main users and we would like to get them to do tux math for 10 minutes which they don't do because of the many distractions on the internet.

So I was wondering if getting the amount of time an application has been run is possible.

share|improve this question
This won't work because they'll just open browser leaving Tux Math running in the background :) – Sergey May 16 '12 at 9:59
yeah that's another thing, but what we might do is write a script on the startup of firefox to get the total time tux math has run. – niccolo m. May 16 '12 at 10:01
up vote 0 down vote accepted

Ok, maybe a different approach: Create a user, that is allowed ONLY to use TuxMath. No Mozilla, no Totem, nothing, except TuxMath. After 10 minutes, You will change thieir priviliges to use other soft, or give them password to different user that is allowed to do other stuff.

share|improve this answer
yep, certainly possible. seems to be an easier approach but tux math won't be forced to them. but they don't have any options, so I guess they will just use it anyway – niccolo m. May 16 '12 at 10:15

Change the shortcut used by the kids to call a bash script, with the time command in it:

time /bin/yourprogram

Then do something with the output of time in the script, such as write the value to a text file or something.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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