Created
October 11, 2013 04:19
-
-
Save lemming/6929544 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
KEYS_BY_ACTION = { next: :Right, prev: :Left, toggle: :space } | |
action = (ARGV.first || 'toggle').to_sym | |
action = :toggle unless KEYS_BY_ACTION.has_key? action | |
unless (window = `xdotool search "Google Play"`[0..-2]).empty? | |
`xdotool keydown --window #{window} #{KEYS_BY_ACTION[action]}` | |
else | |
`mpc #{action}` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment