Sunday, April 16, 2006

Chrome for Firefox and Thunderbird

This one's a post that might be helpful for users of Mozilla Firefox or Thunderbird.

If you're like me (and I know I am), you're not completely happy with the fonts and display styles from either program, and you can't find a theme that really satisfies you. Mozilla calls all of the customization options for the display (other than actual document contents) chrome. I've gone through the trouble of figuring out some of the (undocumented) chrome settings, and now I'm passing the savings along to you with this limited, one-of-a-kind offer.

Sorry...I got carried away there for a moment.

Let's start with Thunderbird, since that's the one that I modified first. I was unhappy with the use of bold to indicate a folder or account with unread messages, since the switch from regular weight to bold changes the letter spacing. When screen real estate is an issue (and when isn't it, honestly?) this gives you the choice of having part of a folder/account name become "..." and wasting space by making the folder pane wider than it typically needs to be. My changes make the account names green, and folders with unread messages red. Accounts with unread messages ideally have their icons change, though that isn't the case for movemail accounts. When you change any of the chrome settings, you'll have to restart the relevant program to see the effects. Ideally, you should make your changes while the program isn't running, but I doubt you'll actually run into any problems, since the chrome file seems to be loaded at startup and then ignored.

The file to change is chrome/userChrome.css in your profile. If this file doesn't exist, create it as you would any other text file. Adding the following lines to userChrome.css will implement the above changes:

treechildren {
  background-color: #F1F1F1 !important;
  font-family: Nimbus Sans L !important;
  font-size: 14px !important; } 

treechildren::-moz-tree-cell-text(unread) {
  font-size: 13pt !important;
  font-family : Nimbus Sans L !important;
  font-weight: normal !important;
  color: #C50000 !important }

treechildren::-moz-tree-cell-text(read) {
  font-size: 13pt ! important;
  font-family : Nimbus Sans L !important; }

treechildren::-moz-tree-cell-text(folderNameCol, hasUnreadMessages-true),
treechildren::-moz-tree-cell-text(folderNameCol, subfoldersHaveUnreadMessages-true)
{
  font-weight: normal !important;
  color: #C50000 !important
}

treechildren::-moz-tree-cell-text(folderNameCol, newMessages-true),
treechildren::-moz-tree-cell-text(folderNameCol, hasUnreadMessages-true),
treechildren::-moz-tree-cell-text(folderNameCol, specialFolder-Inbox, newMessages-true),
treechildren::-moz-tree-cell-text(folderNameCol, biffState-NewMail, isServer-true) {
  font-weight: normal !important;
  color: #C50000 !important
}

treechildren::-moz-tree-cell-text(folderNameCol, isServer-true) {
  font-weight: normal !important;
  color: #00A500 !important
}

Some of this is slightly redundant, and some of it ends up having no effect, but it gets the job done. If you don't like (or don't have) Nimbus Sans L, you can replace it with any other font. The font sizes and colors are also easy to change. Colors are in standard 1-byte hex RGB values, so each color is specified from 00 to FF.

A more recent change that I made was to the overall menu, toolbar, dialog box, and other fonts. I did this to correct for a bunch of changes that recently went into X.org in Debian's unstable distribution. The lines to add are:

* {
  font-family: Nimbus Sans L !important;
  font-size: 14px !important; }

The "*" tells Thunderbird to apply this to everything that isn't otherwise specified.

The modifications I've made for Firefox are almost identical to the last change for Thunderbird. Again, you'll want to modify chrome/userChrome.css for your Firefox profile. Firefox seems to want to use smaller fonts (don't ask me why), so I've added the following lines:

* {
  font-family: Nimbus Sans L !important;
  font-size: 18px !important; }

For some reason, this seems to make the actual text size the same in Firefox as it is in Thunderbird. Your mileage may vary, but at least you now know how to set the font sizes for the browser or mail reader.

As an extra bonus, if you're a Gmail user, you might find some or all of the following useful:

div.msg div.mb {
  font-family: Courier !important;
  font-size: 14px !important;
}

table.tlc {
  font-size: 20px !important;
}

table.cv {
  font-size: 16px !important;
}

table.nb {
  font-size: 16px !important;
}

div.tbc {
  font-size: 16px !important;
}

div.nl {
  font-size: 16px !important;
}

td.ml {
  font-size: 14px !important;
}

This should go in chrome/userContent.css in your Firefox profile. Note that this is userContent.css, not userChrome.css. div.msg and div.mb control the display of messages. I like to use a monospaced font for these, since I often get email that has structured text in it, such as source code snippets or scripts. The rest control various decorations such as the list of folders, the panel with the "Archive" and "Report as spam" buttons and various "Select" options, the account name in the upper-right, etc. Again, once you know how to set these things, you can play around with fonts and sizes. As with the chrome settings, you'll probably have to quit Firefox and start it up again to see the effects. I've tried using the Web Developer extension to modify the Gmail style information interactively, but it doesn't seem to work.

Wednesday, April 05, 2006

Helpful Hints

Let's say you're a deputy press secretary for the Department of Homeland Security, and you're looking for a little online action with a supposed fourteen-year-old girl (SFTYOG). Here are a few hints that the SFTYOG might, in fact, be an undercover sheriff's deputy:

  1. The SFTYOG writes "tee hee" a lot.
  2. The SFTYOG uses the latest slang, like "rad" or "tubular".
  3. The SFTYOG does not recoil in horror when you offer to send her pictures of your naked fifty-five-year-old body.