Last active
December 24, 2015 10:09
-
-
Save Xorlev/6782000 to your computer and use it in GitHub Desktop.
Kato.im Fluid.app userscript to update the dock badge with the # of unread messages.
This file contains 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
// ==UserScript== | |
// @name Kato.im Fluid Dock Badge | |
// @description Displays the unread count of messages, adapted from http://userscripts.org/scripts/review/177616 | |
// @author Michael Rose | |
// ==/UserScript== | |
window.fluid.dockBadge = ''; | |
setTimeout(updateDockBadge, 1000); | |
setTimeout(updateDockBadge, 3000); | |
setInterval(updateDockBadge, 5000); | |
function updateDockBadge() { | |
var newBadge = ''; | |
var totalCount = parseInt($(".badge").html()); | |
if (totalCount > 0) { | |
newBadge = '' + totalCount; | |
} | |
window.fluid.dockBadge = newBadge; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment