The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
0

Send key sequence to running application

asked Oct 18 '13

djcp gravatar image

I'm looking for a way to send a specific sequence of keys to a running application, if it exists. For instance, I'd like to bind Mod + < space > to, say, pause my music player by finding the window named "rdio" and sending a keystoke to it.

Pointers? Thanks!

2 answers

Sort by » oldest newest most voted
0

answered Oct 19 '13

djcp gravatar image

Thanks! "xdotool" was exactly what I needed. This is what I went with, it works great.

# Rdio Pause
bindsym $mod+control+space exec xdotool search --name Rdio && xdotool key --window $(xdotool search --name Rdio) space

# Rdio Next
bindsym $mod+control+n exec xdotool search --name Rdio && xdotool key --window $(xdotool search --name Rdio) Right

# Rdio Previous
bindsym $mod+control+p exec xdotool search --name Rdio && xdotool key --window $(xdotool search --name Rdio) Left
0

answered Oct 18 '13

Flugsio gravatar image

Something like this in your config, haven't tested it.

bindsym $mod+space exec "xdotool key --window $(xdotool search --name Rdio | head -1) space"

Question Tools

Stats

Asked: Oct 18 '13

Seen: 739 times

Last updated: Oct 19 '13