Skip to content

Instantly share code, notes, and snippets.

@NickChristensen
Last active December 30, 2018 22:30
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save NickChristensen/8ef1be8ea1bc07fbcacd to your computer and use it in GitHub Desktop.
Save NickChristensen/8ef1be8ea1bc07fbcacd to your computer and use it in GitHub Desktop.
Userscript for http://fluidapp.com: Sets dock badge to inbox count
window.fluid.dockBadge = '';
setTimeout(updateDockBadge, 1000);
setTimeout(updateDockBadge, 3000);
setInterval(updateDockBadge, 5000);
function updateDockBadge() {
window.fluid.dockBadge = document.querySelector('[title^="Inbox"]').title.match(/\d+/);
}
window.fluid.dockBadge = '';
setTimeout(updateDockBadge, 1000);
setTimeout(updateDockBadge, 3000);
setInterval(updateDockBadge, 5000);
function updateDockBadge() {
var newBadge;
var inboxLink = document.querySelector('[title^="Inbox"]');
var inboxTitle = inboxLink.title;
var newBadge = inboxTitle.match(/\d+/);
window.fluid.dockBadge = newBadge;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment