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

When I start my app using xinit in a new terminal (CTRL+F1) my app needs the cursor to be on it, else the keyboard doesn't answer. So, is there a way to start xinit specifing to do not use the mouse?

share|improve this question
up vote 3 down vote accepted

Install the xdotool package, you can read the manpage at Add a small delay after starting the window and you should be able to set the focus on it from the start script.

share|improve this answer
Smells like a workaround. But maybe I use it, thanks! – Tom Brito Nov 5 '10 at 13:40
It's not a workaround, it's the real solution, it's your responsibility to manage the focus from xinit process. Since you are not using a real windows manager you need to manually manage the window focus. – João Pinto Nov 5 '10 at 14:11
that's a really interesting project, thanks for the reference! – Tom Brito Dec 15 '10 at 11:14

xinit itself does never use the mouse, it's just a program that starts the X server and then launches 1 or more programs that use it.

I guess that maybe X uses "focus follows mouse" by default, and you'll have to unset that manually if you don't use a normal DE...?

share|improve this answer
The cursor will just appear if I start to move it. But I always need to move it, so my app gets the focus and answer to the keyboard. – Tom Brito Nov 4 '10 at 16:58

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.