Last active
February 13, 2023 19:19
-
-
Save petr001/3f18cc7acd8f6cf9120be17d2c0996de to your computer and use it in GitHub Desktop.
Plugin for BitBar to display battery percentage in macOS menu bar when charging your iPhone. Simply download the file and put it to BitBar plugin folder. Remember to install `libimobiledevice` dependency to have it working correctly.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# <bitbar.title>iPhone battery info</bitbar.title> | |
# <bitbar.version>1.0</bitbar.version> | |
# IMPORTANT: | |
# - install libimobiledevice via brew before usage: | |
# $ brew install --HEAD libimobiledevice | |
# - tested with only one iphone connected | |
PATH=$PATH:/usr/local/bin | |
BATTERY=$(ideviceinfo -u $(idevice_id --list) --domain com.apple.mobile.battery | grep BatteryCurrentCapacity | sed 's/BatteryCurrentCapacity: //') | |
if [ "$BATTERY" ]; then | |
echo "📱⚡️" $BATTERY "% | size=12" | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment