Skip to content

Instantly share code, notes, and snippets.

@brcooley
Last active January 4, 2016 10:29
Show Gist options
  • Save brcooley/8609448 to your computer and use it in GitHub Desktop.
Save brcooley/8609448 to your computer and use it in GitHub Desktop.
Easy bash script to play/pause Spotify web player on linux
#!/bin/sh
#
# A script to play/pause songs from the spotify web player
# You should pin the spotify tab, and modify the TAB_POS below
# (e.g. if Spotify is the 3rd tab, replace TAB_POS with ctrl+3)
#
# Requires xdotool, generally available from your package manager
# You'll probably want to bind this to a key
chr=`xdotool search --name chrome | tail -1`
xdotool key --window "$chr" --delay 20 TAB_POS space
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment