Daniel Bergey Commotion

Horsing AroundHorsing AroundThere’s always money in the banana stand1st Barracuda Hockey Game1st Barracuda Hockey Game1st Barracuda Hockey GameGoogle + A2Fiber Flash Mob on the UMich Diag

Seriously, go plug in your computer.

This happens a lot: I’ll be programming along, in the zone, so much that even the low-power alert doesn’t dissuade me from my task:

reservepower.png

That’s bad. Because inevitably, I’ll be just in the middle of a thought when the computer shuts off, ten minutes later. I don’t actually lose anything, of course, because MacBooks are usually smart about keeping enough power to stay alive. (Note: haven’t used anything else for a while; other platforms may do just as well. YMMV.)

Still. It happened so much that I decided to do something about it:

seriouslyplugin.png

I made a new text file, named it "batterywarning" and threw it in /Applications/Scripts/ with the following contents:

#!/usr/bin/env ruby

`pmset -g batt` =~ /discharging; (\d+:(\d+)) remaining/;
if $1 && $1 < '0:10' then
  nums = %w{ zero one two three four five six seven eight nine ten }
  mins = nums[$2.to_i] ? (nums[$2.to_i] +" minute"+ ($2=='01' ? '' : 's')) : $1
  exec "osascript -e 'tell application \"AppleScript Runner\" to "+
    "display alert \"Seriously, go plug in your computer.\" "+
    "message \"There&rsquo;s only about "+ mins + " left! "+
    "How many times do you need to be told?\" as warning'"
end

The gist: when run, the script checks the current estimated remaining time on the battery. If it’s below 10 minutes (the point at which the native warning appears), it displays its own alert box warning the user of their procrastinatory folly. If there is more than 10 minutes remaining, it does nothing.

I made the script executable (chmod +x /path/to/script), and configured launchd to run it every minute by creating a plist named "com.dbergey.batterywarning.plist" in ~/Library/LaunchAgents/ thusly:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.dbergey.batterywarning</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Applications/Scripts/batterywarning</string>
    </array>
    <key>LowPriorityIO</key>
    <true/>
    <key>StartInterval</key>
    <integer>60</integer>
</dict>
</plist>

Then, from the command line, I did this to tell launchd about it:

launchctl load ~/Library/LaunchAgents/com.dbergey.batterywarning.plist 

And it worked! Hopefully I will be more proactive about plugging in when warned up to 10 times before shutoff. :)

Made It

Arrived in South Carolina after 10 hours of driving. My parents et al are still stuck in traffic, having left OH shortly after we did (stopped for dinner in Mt. Vernon, but still). I’m very glad we made it.

Google Maps took us all up and around some back roads that said something to the effect of “15mph curves, 4200ft elevation, next 16 miles.” Got to see loads of forest and the Looking Glass Falls as we carefully blew by, but I think we’ll go back a different way, thank you very much.

Mr. & Mrs. Timothy W. Bergey

Married!

Wedding Rehearsal Day

Too late to write much tonight.

Suffice to say the wedding rehearsal went well, the lasagna and walnut pound cake was awesome, and after we bought a new cooler and 44 lbs of ice in which to put all the leftovers, it fell out of the car onto Mom’s toe. Yeah, the very same one in the “boot”. Not good.

But she put ice on it, and the rest of us all had a good time in the hotel pool until we all got overwhelmed and/or coughy and/or asthmatic from the chlorine and steam.

Concrete

Today my family (parents + siblings remaining at home) was in a minor car accident. Fortunately, there were only minor injuries.

Apparently, a 4-inch-ish piece of concrete struck the windshield of their van while they were traveling to Ohio for my brother’s wedding on Saturday. The glass cut my mom’s arms all up, and the projectile inconveniently struck her in the toe, which is bruised and jammed now.

So if you see her this weekend, that’s why she has a big boot on her foot.

New Theme: Oulipo

Changed my WordPress theme to Oulipo by Andrea Mignolo. I like it because it has nice typography and is still rather minimalist.

I’ve played with some similar ideas over the months/years, but could never seem to get anything together. I don’t have time to make a complete WordPress theme these days anyway. :)

You might need to use FireFox 3.5 or Safari 4 to see it all. I haven’t looked at it in Internet Explorer yet.

Desktop Pictures for Stacked Displays

These days I set my laptop directly below my 20” display, which is set up on some books. I really like the setup, as I don’t have to move my head around to interact with the second display; I can just glance down or straight ahead.

I can’t find any nice desktop pictures, though … all the dual-display desktops are for side-by-side configurations. There are “vertical” desktop pictures, too, but they are designed for when you have your display turned 90°.

Has anyone ever seen desktop pictures designed for stacked displays?

Reggy on Bodega

My friend Sam made something helpful a couple of years ago. I still use it from time to time to test regular expression matching.

reggy_on_bodega.png

Now Reggy is on Bodega, your new corner store for Mac apps. Check ‘em both out.

You're Doing It Wrong

If you’ve ever said to yourself, “I’m a better Christian than {$person} because I …”

… then you’re doing it wrong.

P.S. I used to think some of these things.

Update: Some people have also had trouble with these:

Spiritual Influences and Education

Some of my spiritual influences and education over the past two years:

I also learned from Jon and others that I didn’t have to be a Conservative to be a Christian. It’s okay to disagree with the evangelical world’s consensus on social issues like poverty, war, and homosexuality.

Deconstructing and rebuilding one’s faith is a normal, even necessary part of spirituality. Never stop asking yourself why you believe what you believe, and don’t be afraid to change it if necessary.

So. I think I’ve become more Emergent than anything else these days, with a dash of the Reformation thrown in for good measure. In the next few months, Jennifer and I hope to find a community here in Ann Arbor in which to continue our spiritual conversation.

← Before