Subscribe to
NSLog(); Header Image

Email Count Badge in Screensaver Question

A Freshly Squeezed Software customer sent me an email inquiring as to whether we could do something. I'm not sure it's possible, but I did tell him I'd inquire with the world at large by posting here on my blog:

Inquiry: I would like a badge (at least half-dollar size) to float (in a corner?) ontop of my screen saver. This badge should tell how many emails I have. Possibly like the badge that goes on the Mail icon???

The reason is my screen saver is password protected and I hate having to log in to see if I received any emails or not.

I "think" there use to be something like this out but I could not find it and am not sure it would be compatible with OS X anyway.

Any ideas? I realize one could create a specific screensaver to tell you these kinds of things, but the customer is really looking for something that can be done in any screen saver. Can windows be placed above screensaver level in OS X? If so, a simple little app could do this.

9 Responses to "Email Count Badge in Screensaver Question"

  1. I don't believe there's a way to put a window above the screensaver.

    You could probably accomplish this with a 'shim' screensaver that instantiates another screensaver view and then draws the badge on top of it. Add in a settings sheet that lets you choose the screensaver to be overlayed, and you should be golden.

  2. In other words, he wants the Windows log-in screen... 😉

  3. How about [myWindow setLevel:NSScreenSaverWindowLevel + 1];

  4. I don't know how to do it, but it sure sounds cool. Gmail and news feed counts would be nice...

  5. I'm pretty sure you can put things above the screensaver's window level. Core Graphics kCGScreenSaverWindowLevel is 1000 according to the headers (it should be the same as NSScreenSaverWindowLevel, too). That is a lot less than kCGMaximumWindowLevel, which is LONG_MAX - kCGNumReservedWindowLevels and kCGNumReservedWindowLevels is only 16. You might want to call CGShieldingWindowLevel() and see what that returns; I'd recommend that if you put a window above the screen saver level you should try to also have it be below the shield window level. At any rate, it seems like it should be possible (and perhaps easy) to come up with a little app that displays the desired badge...

  6. I think this is what you are looking for: IconSticker


  7. I couple of years ago at MacHack there was a hack that would do this called Stinking Badges. I believe it was done by an Apple Engineer. I can look into it further and get back to you on it.

  8. Stinkin Badges by John Vink

    I pulled the project off the MacHack 2003 CD. It is hosted on some of my web space but you should not expect it to stay there for a long period of time.

  9. I'd be *very* careful about the implementation on this. The screensaver in Panther and later is kerberized, so, when you enter the password for it, you're updating your credentials to the system, and maybe a much larger network.

    Creating a hole in this would be a bad thing.