Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 Last.fm 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.

Update:

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

for x in `xdotool search --class last.fm`
do
    if ( xprop -id $x WM_WINDOW_ROLE | grep menuControls );
    then
            xdotool type --window $x Ctrl-m
            break
    fi
done
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

 
discard

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.