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

I would like my computer to press the Esc key every 2 minutes. How can I do this? With and app or shell script or otherwise?

share|improve this question
to Browser... Chrome! – Martin Zeltin Aug 28 '11 at 15:21
up vote 13 down vote accepted

You could use xdotool Install xdotool

while true; do
   xdotool key Escape
   sleep 120

You can specify a window with the --window option

share|improve this answer
PERFECT! Thanks! – Martin Zeltin Aug 28 '11 at 15:26
Brilliant! I didn't know about that one :) – Jo-Erlend Schinstad Aug 28 '11 at 15:33

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.