Skip to content

Instantly share code, notes, and snippets.

@heywoodlh
Created April 9, 2023 20:49
Show Gist options
  • Save heywoodlh/1baa13d67544245c11112e58fc45d967 to your computer and use it in GitHub Desktop.
Save heywoodlh/1baa13d67544245c11112e58fc45d967 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
title="Battery"
battery_level="$(pmset -g batt | grep 'InternalBattery' | awk '{print $3 $4}' | awk '{print $1}' | cut -d';' -f1)"
osascript -e "display notification \"${battery_level}\" with title \"${title}\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment