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'd like to be able to bind a global keystroke send a sequence of keystrokes to a specific app.

Specifically: I'm using the client, and I'd like to be able to start/stop music with a global keybinding.

Is there an app that does this? I'm using compiz, if that helps.


I ended up having to write a bash script. Here's the final product: #!/bin/sh

for x in `xdotool search --class`
    if ( xprop -id $x WM_WINDOW_ROLE | grep menuControls );
            xdotool type --window $x Ctrl-m
share|improve this question
up vote 4 down vote accepted

You can use xdotool that provide a --windows parameter to select the destination window and a search command to look for a window by title, name or other.

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.