Created
June 28, 2018 18:42
-
-
Save botanicus/2c096771367ea6ca455f378aad5a8e84 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# TODO: Rewrite to Ruby, so we can parse the config and display proper from - to in the notification. | |
BEFORE=$(networksetup -getairportpower en0) | |
internet-usage-limiter.is_online && /usr/sbin/networksetup -setairportpower en0 on || /usr/sbin/networksetup -setairportpower en0 off | |
if test "$(networksetup -getairportpower en0)" = "Wi-Fi Power (en0): Off" && test "$BEFORE" = "Wi-Fi Power (en0): On"; then | |
osascript -e 'display notification "Your WiFi has been switched off. Use the go-online utility to get online between 9:30 and 18:20." with title "Mindfulness"' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment