Forked from NickChristensen/gmail-inbox-count-terse.js
Created
November 21, 2016 03:57
-
-
Save johanoloflindberg/cb1b7f2f5b5e62279d7f763f999208c4 to your computer and use it in GitHub Desktop.
Userscript for http://fluidapp.com: Sets dock badge to inbox count
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.fluid.dockBadge = ''; | |
setTimeout(updateDockBadge, 1000); | |
setTimeout(updateDockBadge, 3000); | |
setInterval(updateDockBadge, 5000); | |
function updateDockBadge() { | |
window.fluid.dockBadge = document.querySelector('[title^="Inbox"]').title.match(/\d+/); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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