Skip to content

Instantly share code, notes, and snippets.

@paulodeleo
Created February 13, 2015 12:21
Show Gist options
  • Select an option

  • Save paulodeleo/c63c1f3d17047f7b3985 to your computer and use it in GitHub Desktop.

Select an option

Save paulodeleo/c63c1f3d17047f7b3985 to your computer and use it in GitHub Desktop.
Simple ruby (yep, not shell) script using xdotool to pause Spotify on Linux. I bind it to a global hotkey in Ubuntu.
#!/usr/bin/env ruby
windows = `xdotool search --name Spotify`
windows.split("\n").each do |window|
`xdotool key --window #{window} space`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment