Skip to content

Instantly share code, notes, and snippets.

@palikhov
Created February 11, 2019 08:12
Show Gist options
  • Save palikhov/5a952980b8c77a03260a54f3d75f2f25 to your computer and use it in GitHub Desktop.
Save palikhov/5a952980b8c77a03260a54f3d75f2f25 to your computer and use it in GitHub Desktop.
Jukebox keybind: bind playlists/tracks to keys
(function() {
const startPlaylist = (playlistName) => {
$(`#jukeboxfolderroot div.folder-title:contains("${playlistName}")`).closest(".dd-content").find(".playlistcontrols .play").click();
};
const startTrack = (trackName) => {
$(`#jukeboxfolderroot .jukeboxitem .title:contains("${trackName}")`).closest(".dd-content").find(".play").click()
};
Mousetrap.unpause();
Mousetrap.bind("g", () => startPlaylist("my playlist name"));
Mousetrap.bind("j", () => startPlaylist("my other playlist"));
Mousetrap.bind("n", () => startPlaylist("asdf"));
Mousetrap.bind("a", () => startTrack("ye"));
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment