Mac Battery Status

The Mac can self-report some battery information, and Coconut Battery is pretty slick, too. But for someone handy with the command line, it turns out there’s a wealth of information about your battery and charger status.

Matthew.Wagner ~ $ system_profiler SPPowerDataType
Power:

    Battery Information:

      Model Information:
          Serial Number: D864196T1QQFT5YAS
          Manufacturer: SMP
          Device Name: bq20z451
          Pack Lot Code: 0
          PCB Lot Code: 0
          Firmware Version: 702
          Hardware Revision: 000a
          Cell Revision: 379
      Charge Information:
          Charge Remaining (mAh): 6106
          Fully Charged: No
          Charging: Yes
          Full Charge Capacity (mAh): 6271
      Health Information:
          Cycle Count: 112
          Condition: Normal
      Battery Installed: Yes
      Amperage (mA): 1074
      Voltage (mV): 12860

    System Power Settings:

      AC Power:
          System Sleep Timer (Minutes): 0
          Disk Sleep Timer (Minutes): 10
          Display Sleep Timer (Minutes): 62
          Wake on AC Change: No
          Wake on Clamshell Open: Yes
          Wake on LAN: Yes
          AutoPowerOff Delay: 14400
          AutoPowerOff Enabled: 1
          Current Power Source: Yes
          DarkWakeBackgroundTasks: 1
          Display Sleep Uses Dim: Yes
          PrioritizeNetworkReachabilityOverSleep: 0
          Standby Delay: 10800
          Standby Enabled: 1
      Battery Power:
          System Sleep Timer (Minutes): 1
          Disk Sleep Timer (Minutes): 10
          Display Sleep Timer (Minutes): 2
          Wake on AC Change: No
          Wake on Clamshell Open: Yes
          AutoPowerOff Delay: 14400
          AutoPowerOff Enabled: 1
          DarkWakeBackgroundTasks: 0
          Display Sleep Uses Dim: Yes
          Reduce Brightness: Yes
          Standby Delay: 10800
          Standby Enabled: 1

    Hardware Configuration:

      UPS Installed: No

    AC Charger Information:

      Connected: Yes
      ID: 0x0aa1
      Wattage (W): 85
      Family: 0x0085
      Serial Number: 0x00159fe3
      Charging: Yes

Customizing TextMate Next- and Previous-Tab Keyboard Shortcuts

I was kind of surprised to find that TextMate (at least TextMate 2) doesn’t allow you to edit keyboard shortcuts. I found myself repeatedly trying to use the next- and previous-tab shortcuts I use in Chrome while in TextMate, which… didn’t work. A “good” user would probably learn the right shortcuts, but I wanted the software to change, not my brain.

I found most of the solution on Jason Seifer’s blog (thanks!). I never realized you can set application-specific keyboard shortcuts in OS X, and that’s exactly what I needed. Unfortunately, since his post (or maybe between TextMate and TextMate 2), the menu text has changed.

Here’s what I ended up having to do (TextMate 2.0-beta.6 on OS X Yosemite):

  • Open System Preferences / Keyboard
  • Select ‘Shortcuts’ tab
  • Select ‘App Shortcuts’ in the list on the left
  • Add an entry for TextMate
  • Populate it like so:

Screen Shot 2014-12-15 at 5.16.38 PM

And now, viola! Ctrl+Tab advances to the next tab, and Ctrl+Shift+Tab goes to the previous tab—just like in my web browser!