Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. printf "script launched"
  2. while ((1 == 1))
  3. do
  4. sleep 10
  5. pmset -g batt | grep " charging" > /dev/null
  6. if (($? == 1 && $(pmset -g batt | grep % | cut -d% -f1 | rev | colrm 3 | rev) == 20))
  7. then
  8. osascript -e 'display notification "Battery charged at 20% <2705> " with title "Battery information"'
  9. fi
  10. if (($? == 0 && $(pmset -g batt | grep % | cut -d% -f1 | rev | colrm 3 | rev) == 80))
  11. then
  12. osascript -e 'display notification "Battery charged at 80% <2705> " with title "Battery information"'
  13. fi
  14. pmset -g batt | grep % | cut -d% -f1 | rev | colrm 3 | rev
  15. printf "\n"
  16. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement