
If (on_ac_power and card = '9400') or (not on_ac_power and card = '9600'): If (display_status = 'spdisplays_not_connected'): Sp = Popen(, stdout=PIPE).communicate()ĭisplay_status = pl Result = "You\'re on the correct video card." Result = 'You\'re on the wrong video card.' On_ac_power = (structured_power_data = 'TRUE') Structured_power_data = Plist.parse_xml(data) If (display_status.eql?('spdisplays_not_connected')) thenĭata = `system_profiler SPPowerDataType -xml` Structured_video_data = Plist.parse_xml(data)ĭisplay_status = structured_video_data Ruby: (requires the "Plist" gem to be installed) # video_profiler.rbĭata = `system_profiler SPDisplaysDataType -xml` Placing it here for anyone who ever finds this via Google. but this order seems consistent on my machine. they rely on specific data appearing in a particular order in the system_profile plist. I have no idea how fragile these scripts are. Using the basic idea presented in the other two answers, I wrote the following scripts to determine if you are using the "correct" video card (Correct = "on battery and using the 9400" or "on ac adapter and using the 9600") Scripts are below to parse the resulting plist and display the result. I should be able to script something that figures it out from there.ĮDIT2: The key is getting the output from system_profier in the xml format (using the -xml switch). BUT will show "display not connected" for the display attached to the inactive card. The MBP shows information for BOTH video cards, regardless of which is active. I'm also capable of writing my own tool if anyone happens to know where in the API I would look for this information.ĮDIT: The answers below concerning system_profiler are definitely a step in the right direction. I could use that as part of my GeekTool setup.

As far as I can tell, you have to open the Energy Saver System Preference to see which one is active.ĭoes anyone know of a tool that will display (in the menu bar, on the desktop, whatever) my current video card status? Especially good would be a terminal command that would report which one was active. This can end up with a dead battery while on an airplane pretty quickly. The problem is, I often forget which one I am running. There is a big difference in both performance and power consumption between the two video cards in a MacBook Pro.
