Touchbar widget of wattage from charger

#1

I'm wondering if anyone knows of a way to display on the touchbar the wattage being provided by a charger when plugged in.
In System Report, at the bottom of the power page, it lists the Charging wattage. It would be very handy to me if that was accessible within my touchbar.

0 Likes

#2

You can create a new Widget, make it run a shell script and write down the following:

system_profiler SPPowerDataType | grep Wattage | awk '{printf "Wattage: %d", $3}'

Here is the widget:

{
  "BTTWidgetName" : "Wattage",
  "BTTTriggerType" : 642,
  "BTTTriggerTypeDescription" : "Shell Script \/ Task Widget",
  "BTTTriggerClass" : "BTTTriggerTypeTouchBar",
  "BTTPredefinedActionType" : -1,
  "BTTPredefinedActionName" : "No Action",
  "BTTShellScriptWidgetGestureConfig" : "\/bin\/bash:::-c",
  "BTTEnabled2" : 1,
  "BTTUUID" : "47D57D9C-31EE-4F29-8C97-5FAF1EE5F493",
  "BTTEnabled" : 1,
  "BTTModifierMode" : 0,
  "BTTOrder" : 59,
  "BTTDisplayOrder" : 0,
  "BTTMergeIntoTouchBarGroups" : 0,
  "BTTTriggerConfig" : {
    "BTTScriptType" : 0,
    "BTTTouchBarButtonColor" : "75.323769, 75.323769, 75.323769, 255.000000",
    "BTTTouchBarItemIconWidth" : 22,
    "BTTTouchBarShellScriptString" : "system_profiler SPPowerDataType | grep Wattage | awk '{printf \"Wattage: %d\", $3}'",
    "BTTTouchBarItemPlacement" : 1,
    "BTTTouchBarAlternateBackgroundColor" : "128.829533, 128.829533, 128.829533, 255.000000",
    "BTTTouchBarButtonCornerRadius" : 6,
    "BTTTouchBarScriptUpdateInterval" : 5,
    "BTTTouchBarAppleScriptStringRunOnInit" : false,
    "BTTTouchBarButtonName" : "Wattage",
    "BTTTouchBarFreeSpaceAfterButton" : 5,
    "BTTTouchBarItemIconHeight" : 22,
    "BTTTouchBarItemPadding" : 0
  }
}
0 Likes

#3

WOW! Amazing help, thank you so much!

0 Likes