{"id":50989133,"url":"https://github.com/roypadina/LanGuard","last_synced_at":"2026-07-07T22:00:47.060Z","repository":{"id":362676585,"uuid":"1260308874","full_name":"roypadina/LanGuard","owner":"roypadina","description":"macOS menu-bar app: turns Wi-Fi off on wired LAN, back on when unplugged. Wake-aware, per-interface, no admin.","archived":false,"fork":false,"pushed_at":"2026-06-09T07:46:23.000Z","size":4655,"stargazers_count":19,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-06-26T06:32:19.890Z","etag":null,"topics":["automation","corewlan","ethernet","homebrew","macos","macos-app","menu-bar","menubar-app","network","networking","open-source","swift","swiftui","systemconfiguration","utility","wifi"],"latest_commit_sha":null,"homepage":"https://github.com/roypadina/LanGuard","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roypadina.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"ko_fi":"roypadina","github":["roypadina"]}},"created_at":"2026-06-05T11:04:38.000Z","updated_at":"2026-06-18T03:18:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/roypadina/LanGuard","commit_stats":null,"previous_names":["roypadina/languard"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/roypadina/LanGuard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roypadina%2FLanGuard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roypadina%2FLanGuard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roypadina%2FLanGuard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roypadina%2FLanGuard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roypadina","download_url":"https://codeload.github.com/roypadina/LanGuard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roypadina%2FLanGuard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35243953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-07T02:00:07.222Z","response_time":90,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["automation","corewlan","ethernet","homebrew","macos","macos-app","menu-bar","menubar-app","network","networking","open-source","swift","swiftui","systemconfiguration","utility","wifi"],"created_at":"2026-06-20T00:00:28.872Z","updated_at":"2026-07-07T22:00:47.013Z","avatar_url":"https://github.com/roypadina.png","language":"Swift","funding_links":["https://ko-fi.com/roypadina","https://github.com/sponsors/roypadina"],"categories":["Menubar"],"sub_categories":["Text"],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"docs/social-preview.png\" alt=\"LanGuard — Wi-Fi off when you're wired, back on when you're not. A free, open-source macOS menu-bar app.\" width=\"760\"\u003e\n\n# LanGuard\n\n### Wi-Fi off when you're wired. Back on when you're not.\n\nA tiny native macOS menu-bar app that turns **Wi-Fi off the moment a wired LAN link goes up**,\nand back **on when you unplug** — edge-based, wake-aware, per-interface, and no admin rights required.\n\n[![macOS](https://img.shields.io/badge/macOS-14%2B-000000?logo=apple\u0026logoColor=white)](https://www.apple.com/macos/)\n[![Swift](https://img.shields.io/badge/Swift-5-F05138?logo=swift\u0026logoColor=white)](https://swift.org)\n[![Homebrew](https://img.shields.io/badge/brew-roypadina%2Ftap-FBB040?logo=homebrew\u0026logoColor=white)](https://github.com/roypadina/homebrew-tap)\n[![Release](https://img.shields.io/github/v/release/roypadina/LanGuard?logo=github\u0026label=release)](https://github.com/roypadina/LanGuard/releases/latest)\n[![CI](https://github.com/roypadina/LanGuard/actions/workflows/ci.yml/badge.svg)](https://github.com/roypadina/LanGuard/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg?logo=opensourceinitiative\u0026logoColor=white)](LICENSE)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?logo=github)](CONTRIBUTING.md)\n[![Stars](https://img.shields.io/github/stars/roypadina/LanGuard?style=social)](https://github.com/roypadina/LanGuard/stargazers)\n\n\u003cbr\u003e\n\n\u003cimg src=\"docs/demo.gif\" alt=\"LanGuard in action: when the wired LAN link goes active the menu-bar indicator flips to LAN and Wi-Fi powers off; when it goes inactive the indicator returns to Wi-Fi and Wi-Fi comes back on.\" width=\"720\"\u003e\n\n\u003csub\u003e\u003ci\u003eWired link goes up → indicator flips to \u003cb\u003eLAN\u003c/b\u003e and Wi-Fi powers off · link goes down → back to \u003cb\u003eWi-Fi\u003c/b\u003e.\u003c/i\u003e\u003c/sub\u003e\n\n\u003c/div\u003e\n\n---\n\n## Table of Contents\n\n- [Why](#why)\n- [Features](#features)\n- [How LanGuard compares](#how-languard-compares)\n- [Install](#install)\n- [Usage](#usage)\n- [How it works](#how-it-works)\n- [Is it safe?](#is-it-safe)\n- [FAQ](#faq)\n- [Uninstall](#uninstall)\n- [Reporting a bug](#reporting-a-bug)\n- [Contributing](#contributing)\n- [Support](#support)\n- [License](#license)\n\n## Why\n\nmacOS keeps Wi-Fi on even when you're docked over Ethernet — wasting an IP lease, adding a\nsecond default route, sometimes sending traffic out the wrong interface, and leaving an extra\nradio exposed. LanGuard switches Wi-Fi **off** the instant a wired link is active and switches\nit back **on** when the cable's gone. It only acts on plug/unplug **transitions**, so if you\nmanually flip Wi-Fi back on while docked, it stays on until you next unplug.\n\n## Features\n\n| | |\n|---|---|\n| 🔌 **Edge-based** | Acts only on wired plug/unplug transitions — your manual Wi-Fi changes are respected. |\n| 😴 **Wake-aware** | A transition that happened while asleep is detected and corrected on wake. |\n| 🎛️ **Per-interface** | Pick which wired adapters trigger and which Wi-Fi adapters are controlled. |\n| 🧪 **Ignores virtual NICs** | Bridge / VPN / VM adapters (e.g. VMware `vmnet`) are off by default so they can't pin Wi-Fi off. |\n| 🔔 **Notifications** | Optional banner whenever Wi-Fi is toggled. |\n| 🧭 **Configurable indicator** | Menu-bar shows `LAN` / `Wi-Fi` / `Off` — icon only, icon + label, or label only. |\n| ⏸️ **Master switch** | Pause all automatic toggling from the menu. |\n| 🚀 **Start at login** | Self-healing login item — re-registers if the app moves; prompts if macOS needs approval. |\n| 🔐 **No admin, no sudo** | Wi-Fi power via CoreWLAN, link state via SystemConfiguration. No network calls of its own. |\n\n\u003e **Menu-bar indicator** (icon + label style):\n\u003e\n\u003e ![LanGuard menu-bar indicator showing \"LAN\" while a wired link is active](docs/screenshots/menubar.png)\n\u003e\n\u003e _An open-menu screenshot is still welcome — see [#1](https://github.com/roypadina/LanGuard/issues/1)._\n\n## How LanGuard compares\n\n|  | **LanGuard** | BridgeChecker | ToggleWifi |\n|---|:---:|:---:|:---:|\n| Price | **Free** | Paid (~$50) | Free |\n| Open source | ✅ (MIT) | ❌ | ✅ |\n| Per-interface selection | ✅ | ✅ | ❌ |\n| Edge-based (respects manual toggle) | ✅ | — | — |\n| Wake-from-sleep handling | ✅ | — | not documented |\n| No admin / sudo | ✅ | — | ❌ (needs admin) |\n\n\u003csub\u003eComparison based on each project's public docs at time of writing; verify current details on their sites. LanGuard is **not** notarized (ad-hoc signed) — see [Is it safe?](#is-it-safe).\u003c/sub\u003e\n\n## Install\n\n\u003e **Requires macOS 14+ (Sonoma).**\n\n### Homebrew\n\n```bash\nbrew install --cask roypadina/tap/languard\n```\n\n\u003e LanGuard is ad-hoc signed (not notarized). On first launch, **right-click it in\n\u003e `/Applications` → Open** (then Open again), or run once:\n\u003e ```bash\n\u003e xattr -dr com.apple.quarantine \"/Applications/LanGuard.app\"\n\u003e ```\n\u003e See [Is it safe?](#is-it-safe) for why.\n\n### Build from source\n\n```bash\ngit clone https://github.com/roypadina/LanGuard.git\ncd LanGuard\nxcodebuild -workspace LanGuard.xcworkspace -scheme LanGuard -configuration Release build\ncp -R ~/Library/Developer/Xcode/DerivedData/LanGuard-*/Build/Products/Release/LanGuard.app /Applications/\nopen /Applications/LanGuard.app\n```\n\nThe app lives in the menu bar (no Dock icon). On first launch, click **Allow** on the\nnotification prompt if you want toggle banners.\n\n## Usage\n\nClick the menu-bar icon for status, the **Auto-toggle** master switch, and **Settings…**.\n\nIn **Settings** you can:\n- choose which **wired adapters** count as triggers (real adapters on by default, virtual off),\n- choose which **Wi-Fi adapters** are controlled,\n- toggle **notifications**,\n- pick the **menu-bar icon style** (icon / icon + label / label),\n- enable **Start at login**.\n\n\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"docs/screenshots/settings.png\" alt=\"LanGuard Settings: Auto-toggle, Start at login, notifications, menu-bar icon style, per-interface Wired triggers (with the active link dotted green) and Controlled Wi-Fi adapters.\" width=\"380\"\u003e\n\n\u003c/div\u003e\n\n## How it works\n\n```\nwired link UP   ─▶  Wi-Fi OFF\nwired link DOWN ─▶  Wi-Fi ON\n(no edge)       ─▶  leave Wi-Fi alone   ← respects manual override\n```\n\n| Component | Role |\n|---|---|\n| `NetworkMonitor` | `SCDynamicStore` link/IP callbacks + `NSWorkspace` wake notification |\n| `WiFiController` | CoreWLAN power on/off (no sudo) |\n| `ToggleEngine`   | Edge state machine — dependency-injected, fully unit-tested |\n| `InterfaceCatalog` | Enumerate + classify Ethernet/Wi-Fi; flag virtual adapters |\n| `LoginItem` | `SMAppService` login item (self-healing) |\n| `Notifier` | `UNUserNotificationCenter` banners |\n\nSee the [Wiki](https://github.com/roypadina/LanGuard/wiki) for deeper docs,\n[`CHANGELOG.md`](CHANGELOG.md) for release history, and [`CLAUDE.md`](CLAUDE.md) for the\nfull component map.\n\n## Is it safe?\n\nFair question — it toggles your network and launches at login. Here's the honest picture:\n\n- **Open source (MIT).** Every line is in this repo; read or build it yourself.\n- **No network calls of its own. No ads, no analytics, no tracking.** It uses local macOS\n  networking APIs (CoreWLAN, SystemConfiguration). The only external tools it ever runs are\n  read-only `ifconfig` (a link-state fallback) and a one-time `launchctl` to remove the legacy\n  LaunchAgent — never `networksetup`, never with elevated privileges.\n- **No admin / sudo.** It never asks for your password or installs a privileged helper.\n- **Ad-hoc signed, _not_ notarized.** That's the one rough edge: macOS can't verify the\n  developer, so the first launch is blocked until you **right-click → Open** (or clear\n  quarantine with the `xattr` command above). Notarization needs a paid Apple Developer ID;\n  it's on the roadmap. If you'd rather not trust a prebuilt binary, **build from source**.\n- Each release ships a **SHA-256** for the download so you can verify it.\n\n## FAQ\n\n**Wi-Fi turned back on by itself while I was docked — bug?**\nNo. LanGuard is *edge-based*: it acts only at the moment you plug/unplug. If you (or another\napp) turn Wi-Fi on while wired, LanGuard respects that until your next unplug/replug.\n\n**I'm docked but Wi-Fi stayed on.**\nEither you turned it on manually since plugging in (see above), or that wired adapter isn't\nselected as a trigger in Settings (virtual adapters are off by default).\n\n**Does it work with USB-C / Thunderbolt docks and USB-Ethernet adapters?**\nYes — any adapter macOS reports as an Ethernet interface. You choose which ones count.\n\n**Why is my VPN / VM adapter ignored?**\nVirtual adapters (VPN tunnels, VMware/Parallels `vmnet`, bridges) are off by default so they\ncan't be mistaken for a real wired link. You can opt any of them in under Settings.\n\n**Does it need admin rights?**\nNo. Wi-Fi power goes through CoreWLAN and link state through SystemConfiguration, both as your\nnormal user.\n\n**macOS says it \"can't verify the developer.\"**\nIt's not notarized yet — right-click the app → Open, or run the `xattr` command in\n[Install](#install). See [Is it safe?](#is-it-safe).\n\n## Uninstall\n\n```bash\nbrew uninstall --cask languard          # if installed via Homebrew\n# or just drag /Applications/LanGuard.app to the Trash\n\ndefaults delete com.roy.languard        # forget all settings (optional)\n```\nAlso remove it under **System Settings → General → Login Items** if it's still listed.\n\n## Reporting a bug\n\nHit something odd (Wi-Fi toggling when it shouldn't, etc.)? Turn on **Settings → Debug →\nEnable debug logging**, reproduce it, then click **Reveal Logs in Finder** and attach\n`~/Library/Logs/LanGuard/languard.log` to your [issue](https://github.com/roypadina/LanGuard/issues).\nThe log stays on your Mac and contains only interface names + toggle decisions (no personal data).\n\n## Contributing\n\nPRs welcome! `main` is protected — fork, branch, add tests, and open a PR. Good first issues are\n[labeled here](https://github.com/roypadina/LanGuard/labels/good%20first%20issue). See\n[CONTRIBUTING.md](CONTRIBUTING.md) and the [Code of Conduct](CODE_OF_CONDUCT.md).\n\n```bash\ncd LanGuardPackage \u0026\u0026 swift test   # pure logic, no hardware needed\n```\n\n## Support\n\nIf LanGuard saves you some battery and annoyance, you can\n[**buy me a coffee on Ko-fi ☕**](https://ko-fi.com/roypadina) — totally optional, always appreciated.\nA **⭐ star** helps just as much.\n\n## License\n\n[MIT](LICENSE) © Roy Padina\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froypadina%2FLanGuard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froypadina%2FLanGuard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froypadina%2FLanGuard/lists"}