Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save johanoloflindberg/cb1b7f2f5b5e62279d7f763f999208c4 to your computer and use it in GitHub Desktop.
Save johanoloflindberg/cb1b7f2f5b5e62279d7f763f999208c4 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