From c3ad131803b3a43a65f57b9d16bc91eb15382ac7 Mon Sep 17 00:00:00 2001 From: scottydelta Date: Thu, 22 Oct 2015 22:37:23 -0700 Subject: [PATCH] Added commands for remaining battery backup time and percentage. --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 82e09e5..f4b1efc 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ If you want to contribute, you are highly encouraged to do so. Please read the [ - [AirDrop](#airdrop) - [AppleScript](#applescript) - [Basics](#basics) + - [Battery Status](#battery-status) - [Clipboard](#clipboard) - [FileVault](#filevault) - [Information/Reports](#informationreports) @@ -875,6 +876,20 @@ How long since your last restart. uptime ``` +### Battery Status + +#### Battery Percentage +Remaining battery in percentage. +```bash +pmset -g batt | egrep "([0-9]+\%).*" -o --colour=auto | cut -f1 -d';' +``` + +#### Remaining Batter Time +Remaining battery backup time. +```bash +pmset -g batt | egrep "([0-9]+\%).*" -o --colour=auto | cut -f3 -d';' +``` + ### Clipboard #### Copy data to Clipboard