Subscribe to
NSLog(); Header Image

Customizing PulpFiction’s Dock Badge

Pulpfiction Dock IconWe use a few defaults in PulpFiction to control the badge, and though you can't ever change them in the UI, they're quite accessible to those who what they're doing. The keys are FSSDockBadgeColor, FSSDockBadgeTextColor, and FSSDockBadgePosition. Here are some pertinent code snippets. You should be able to figure out what you need to do to set your own badge colors and positions:

[defaults setObject:[NSArray arrayWithObjects: [NSNumber numberWithFloat:0.0],
                                               [NSNumber numberWithFloat:.5],
                                               [NSNumber numberWithFloat:0.0],
                                               [NSNumber numberWithFloat:1.0], nil]
[defaults setObject:[NSArray arrayWithObjects:[NSNumber numberWithFloat:1.0],
                                              [NSNumber numberWithFloat:1.0],
                                              [NSNumber numberWithFloat:1.0],
                                              [NSNumber numberWithFloat:1.0], nil]
[defaults setObject:[NSNumber numberWithInt:FSSTopRight]

As you'll note, "FSSTopRight" isn't a string. So, here's the enum:

typedef enum FSSBadgeCorner 
    FSSTopRight = 0,
    FSSTopLeft = 1,
    FSSBottomRight = 2,
    FSSBottomLeft = 3
} FSSBadgeCorner;

Customize away! Link to screenshots of your favorite combination of colors and position (and list the numbers you use) in the comments - perhaps we'll change the default.