Skip to content

Instantly share code, notes, and snippets.

@bradjasper bradjasper/remove_focus.sh
Last active Aug 29, 2015

Embed
What would you like to do?
Remove Focus
#!/bin/bash
ACTIVE_NETWORK=$(echo "open|||get Setup:/Network/Service/$(echo "open|||get State:/Network/Global/IPv4|||d.show" | tr '|||' '\n' | scutil | grep "PrimaryService" | awk '{print $3}') |||d.show" | tr '|||' '\n' | scutil | grep "UserDefinedName" | awk -F': ' '{print $2}')
echo "Active network is '$ACTIVE_NETWORK'"
echo "Turning off active network PAC"
sudo networksetup -setautoproxystate "$ACTIVE_NETWORK" off
echo "Removing NSUserDefaults"
rm -rf ~/Library/Preferences/BradJasper.focus*
rm ~/Library/Containers/BradJasper.focus/Data/Library/Preferences/BradJasper.focus.plist
defaults delete BradJasper.focus
echo "Removing CoreData"
rm -rf ~/Library/Application\ Support/Focus/
echo "Killing helper tool"
ps aux | grep BradJasper.focus.HelperTool | grep -v grep | awk '{print $2}' | xargs sudo kill -9
sudo rm -rf /Library/PrivilegedHelperTools/BradJasper.focus.HelperTool
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.