Skip to content

Instantly share code, notes, and snippets.

@thebitguru
Last active February 21, 2019 08:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thebitguru/cbf7d739fed6516161465429964f3e31 to your computer and use it in GitHub Desktop.
Save thebitguru/cbf7d739fed6516161465429964f3e31 to your computer and use it in GitHub Desktop.
A simple BeardedSpice (https://github.com/beardedspice/beardedspice) strategy for ignoring media keys.
//
// Abyss.js
// BeardedSpice
//
// Created by Farhan Ahmad on 12/2/2018.
// Copyright (c) 2016 GPL v3 http://www.gnu.org/licenses/gpl.html
//
// We put the copyright inside the file to retain consistent syntax coloring.
// Use a syntax checker to ensure validity. One is provided by nodejs (`node -c filename.js`)
// Normal formatting is supported (can copy/paste with newlines and indentations)
BSStrategy = {
version: 1,
displayName: "Abyss - Ignore Events",
accepts: {
// method: "predicateOnTab" /* OR "script" */,
method: "script",
/* Use these if "predicateOnTab" */
// format: "%K LIKE[c] '*[YOUR-URL-DOMAIN-OR-TITLE-HERE]*'",
// args: ["URL" /* OR "title" */],
/* Use "script" if method is "script" */
/* script: function () { "javascript that returns a boolean value" } */
script: function () { return true; }
},
isPlaying: function () { return true; },
toggle: function () { },
previous: function () { },
next: function () { },
pause: function () { },
favorite: function () { },
/*
- Return a dictionary of namespaced key/values here.
All manipulation should be supported in javascript.
- Namespaced keys currently supported include: track, album, artist, favorited, image (URL)
*/
trackInfo: function () {
return {
'track': 'Ignore Media Keys',
'album': '',
'artist': '',
'image': '',
'favorited': false,
};
}
}
// The file must have an empty line at the end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment