{"id":13588036,"url":"https://github.com/eprev/locationchanger","last_synced_at":"2025-04-06T06:14:12.478Z","repository":{"id":33327961,"uuid":"36972716","full_name":"eprev/locationchanger","owner":"eprev","description":"Change OS X’s network location based on the name of Wi-Fi network","archived":false,"fork":false,"pushed_at":"2022-12-20T21:17:28.000Z","size":19,"stargazers_count":406,"open_issues_count":10,"forks_count":69,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-03-30T05:09:45.098Z","etag":null,"topics":["mac-osx","network-location","wi-fi","wireless-network"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eprev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-06T08:15:23.000Z","updated_at":"2025-03-26T03:56:33.000Z","dependencies_parsed_at":"2023-01-15T00:29:57.535Z","dependency_job_id":null,"html_url":"https://github.com/eprev/locationchanger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eprev%2Flocationchanger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eprev%2Flocationchanger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eprev%2Flocationchanger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eprev%2Flocationchanger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eprev","download_url":"https://codeload.github.com/eprev/locationchanger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441062,"owners_count":20939239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mac-osx","network-location","wi-fi","wireless-network"],"created_at":"2024-08-01T15:06:28.622Z","updated_at":"2025-04-06T06:14:12.453Z","avatar_url":"https://github.com/eprev.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# Location Changer\n\nIt automatically changes OS X’s [network location](https://support.apple.com/en-us/HT202480)\nbased on the name of Wi-Fi network and runs arbitrary scrips when it happens.\n\n## Installation \u0026 Update\n\n```\ncurl -L https://github.com/eprev/locationchanger/raw/master/locationchanger.sh | bash\n```\n\nIt will ask you for a root password to install `locationchanger` to the */usr/local/bin* directory.\n\n## Basic usage\n\nYou have to name network locations after Wi-Fi networks. Let’s say, you need to have\na specific network preferences for “Corp Wi-Fi” wireless network, then you have to create\na location “Corp Wi-Fi”. Now, the network location will change to “Corp Wi-Fi” automatically,\nif you connect to that wireless network. And if you connect to the Wi-Fi network that you\ndon’t have a location for, then the location will change to the default one (“Automatic”).\n\nIf you want to run a script every time you connect to a specific Wi-Fi network, then put\nthose scripts in *~/.locations* and name them after Wi-Fi networks (making sure you set\ncorresponding network locations). For instance, you have a script that changes security\npreferences when you connect to the “Corp Wi-Fi” network:\n\n```bash\n#!/usr/bin/env bash\nexec 2\u003e\u00261\n\n# Require password immediately after sleep or screen saver begins\nosascript -e 'tell application \"System Events\" to set require password to wake of security preferences to true'\n```\n\nThen name this script as *~/.locations/Corp Wi-Fi*. And you might want to create\n*~/.locations/Automatic* that will reset those changes:\n\n```bash\n#!/usr/bin/env bash\nexec 2\u003e\u00261\n\n# Don’t require password immediately after sleep or screen saver begins\nosascript -e 'tell application \"System Events\" to set require password to wake of security preferences to false'\n```\n\n## Aliasing\n\nIf you want to share one network location between different wireless networks (for instance, you have a wireless router which broadcasts on 2.4 and 5GHz bands simultaneously), then you can create a configuration file *~/.locations/locations.conf* (plain text file with simple key-value pairs, no spaces in between):\n\n```bash\nWi-Fi_5GHz=Wi-Fi\n```\n\nWhere the keys are the wireless network names and the values are the desired location names.\n\n## Troubleshooting\n\nIt writes quite extensive information to the log file every time the wireless network changes:\n\n```bash\ntail -f ~/Library/Logs/LocationChanger.log\n```\n\nSample output:\n\n```\nConnected to 'Wi-Fi_5GHz'\nWill switch the location to 'Wi-Fi' (configuration file)\nChanging the location to 'Wi-Fi'\nRunning '~/.locations/Wi-Fi'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feprev%2Flocationchanger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feprev%2Flocationchanger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feprev%2Flocationchanger/lists"}