Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- printf "script launched"
- while ((1 == 1))
- do
- sleep 10
- pmset -g batt | grep " charging" > /dev/null
- if (($? == 1 && $(pmset -g batt | grep % | cut -d% -f1 | rev | colrm 3 | rev) == 20))
- then
- osascript -e 'display notification "Battery charged at 20% <2705> " with title "Battery information"'
- fi
- if (($? == 0 && $(pmset -g batt | grep % | cut -d% -f1 | rev | colrm 3 | rev) == 80))
- then
- osascript -e 'display notification "Battery charged at 80% <2705> " with title "Battery information"'
- fi
- pmset -g batt | grep % | cut -d% -f1 | rev | colrm 3 | rev
- printf "\n"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement