Skip to content

edwardloveall/autolock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

This script checks every five minutes (configurable) to see if you're on a specified safe network, such as your home network. If you are, it disables the "Require password X seconds after sleep or screensaver begins" preference on a Mac. If it can't find that network, it enables that lock preference.

In practice, this means your computer will require a password when you're out and about, but not force you to enter your password over and over again at home.

Installation

  • Download the latest files from here.
  • Put autolock.sh anywhere you like, but remember where you put it.
  • Inside autolock.sh, replace Death Star on the first line with the SSID (name) of your home network.
    • Alternatively, change your network name to Death Star.
  • In com.edwardloveall.autolock.plist, replace the path/to/autolock.sh with the path to the script in the previous step.
  • Move the launchd plist to ~/Library/LaunchAgents. If you don't have the LaunchAgents folder, you can just create it. Spelling and capitalization are important.
  • Install and start the launchd job with launchctl load -w ~/Library/LaunchAgents/com.edwardloveall.autolock.plist

Read more about this in my blog post: https://blog.edwardloveall.com/automatically-lock-your-computer-based-on-wi-fi

About

Automatically require a password for your computer when away from home

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages