Super User is a question and answer site for computer enthusiasts and power users. 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 there a way of invoking a key combination over the CLI?

I mean something like:

$ invoke ALT+4

share|improve this question
Can you provide some context for why you would want to do this? Are you connected to the physical console, in an X11 session, connected via ssh/other? – Zoredache Feb 10 '12 at 19:13
X11, ubuntu oneiric desktop edition. I just need to invoke those keys after X minutes, for example CTRL+ALT+L to Lock Screen after X minutes – w0rldart Feb 10 '12 at 19:17
Why wouldn't you use one of the many screen saver programs for that purpose? – Zoredache Feb 10 '12 at 19:21
that was an example, I do want to know how invoke key combinations :) – w0rldart Feb 10 '12 at 19:28
Ok, but to be clear, you are primarily concerned with how to do this under X11? Since the methods for a remote terminal, console, and X11 will each be different. – Zoredache Feb 10 '12 at 19:37
up vote 3 down vote accepted

The cloest I can find in some quick Google searches might be something like xdotool.

What is xdotool? This tool lets you simulate keyboard input and mouse activity, move and resize windows, etc. It does this using X11's XTEST extension and other Xlib functions.

share|improve this answer

you can also try virtual keyboard xvkbd.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .