Skip to content

Commit

Permalink
📦 NEW: macOS battery % function
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadawais committed Oct 17, 2018
1 parent 5b5dcf5 commit 6dbb26f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions demo/shellscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ function rainbow() {
yes "$(seq 231 -1 16)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .02; done
}

# Show macOS Battery Percentage.
function battery() {
pmset -g batt | egrep "([0-9]+\%).*" -o --colour=auto | cut -f1 -d';'
}

0 comments on commit 6dbb26f

Please # to comment.