Skip to content

Commit

Permalink
Add plugin get ac power adapter wattage. (#1385)
Browse files Browse the repository at this point in the history
* add power wattage plugin

* update image
  • Loading branch information
tresni authored Mar 5, 2020
1 parent 573bb32 commit 50a034e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions System/power_wattage.30s.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
#
# <bitbar.title>Power Wattage</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>vxider</bitbar.author>
# <bitbar.author.github>vxider</bitbar.author.github>
# <bitbar.desc>The AC power adapter wattage for macos</bitbar.desc>
# <bitbar.image>https://i.imgur.com/4N0xk1g.jpg</bitbar.image>
# <bitbar.dependencies></bitbar.dependencies>
# <bitbar.abouturl></bitbar.abouturl>

power_wattage="$(/usr/sbin/system_profiler SPPowerDataType | grep "Wattage (W)" | awk "{print \$3\"W\"}")"

if [ -z "$power_wattage" ]
then
echo "🔋"
else
echo "🔌${power_wattage}"
fi

echo "---"
echo "Refresh... | refresh=true"

0 comments on commit 50a034e

Please sign in to comment.