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 2013-10-18 17:22:00 +0000

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!

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2013-10-19 03:40:06 +0000

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
edit flag offensive delete link more
0

answered 2013-10-18 22:54:32 +0000

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"

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-10-18 17:22:00 +0000

Seen: 739 times

Last updated: Oct 19 '13