Last active
December 30, 2018 22:30
-
-
Save NickChristensen/8ef1be8ea1bc07fbcacd 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