https://github.com/fahidnasir/togglewifi
π Intelligent macOS menu bar application that automatically toggles Wi-Fi based on Ethernet connection status. Built with SwiftUI and supports multiple languages.
https://github.com/fahidnasir/togglewifi
automation ethernet macos menubar menubar-app multilingual network swift swiftui utility wifi
Last synced: 2 months ago
JSON representation
π Intelligent macOS menu bar application that automatically toggles Wi-Fi based on Ethernet connection status. Built with SwiftUI and supports multiple languages.
- Host: GitHub
- URL: https://github.com/fahidnasir/togglewifi
- Owner: fahidnasir
- License: mit
- Created: 2025-07-11T23:26:34.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-07-12T00:27:02.000Z (12 months ago)
- Last Synced: 2025-07-12T02:53:59.042Z (12 months ago)
- Topics: automation, ethernet, macos, menubar, menubar-app, multilingual, network, swift, swiftui, utility, wifi
- Language: Swift
- Homepage: https://github.com/fahidnasir/ToggleWiFi
- Size: 151 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ToggleWiFi

π Intelligent Wi-Fi Management for macOS
A lightweight menu bar application that automatically toggles Wi-Fi based on Ethernet connection status, helping you maintain optimal network performance and battery life.
## β¨ Features
- **π Automatic Wi-Fi Toggle**: Intelligently disables Wi-Fi when Ethernet is connected
- **π± Menu Bar Integration**: Clean, native macOS menu bar interface
- **π Multi-Language Support**: Available in English and German
- **π Native Notifications**: System notifications for connection changes
- **βοΈ Customizable Settings**: Configure auto-toggle behavior and launch preferences
- **π Launch at Login**: Optional automatic startup
- **π― Manual Override**: Click to manually toggle Wi-Fi when needed
- **π Real-time Status**: Live connection status monitoring
## Screenshots
### Application Workflow


### Settings Screen
#### English

#### German

### Menubar

### Notifications upon status change

---
## π₯οΈ System Requirements
- macOS 14.0 or later
- Xcode 15.0 or later (for building from source)
- Administrator privileges (for network interface control)
## π Installation
### Option 1: Build from Source
1. **Clone the repository**
```bash
git clone https://github.com/fahidnasir/ToggleWiFi.git
cd ToggleWiFi
```
2. **Open in Xcode**
```bash
open ToggleWiFi.xcodeproj
```
3. Build and Run
- Select your development team in project settings
- Build and run the project (β+R)
### Option 2: Download Release
Visit the Releases page
Download the latest .dmg file
Install the application
β οΈ Note: macOS may show a security warning when opening this app for the first time.
Option 1: Right-click on the App Icon in /Applications β Open β Allow Anyway.
Option 2: Open "Privacy & Security" in Mac settings window and scroll down to the bottom and last security failed app will appear there and you can Allow Anyway.
### π― Usage
Launch the app - ToggleWiFi will appear in your menu bar
Left-click the icon to manually toggle Wi-Fi
Right-click the icon to access settings and options
Configure settings to enable/disable automatic behavior
Choose your language from the settings panel
### Menu Options
Enable Auto Wi-Fi: Toggle automatic Wi-Fi management
Settings: Configure app preferences and view status
About: View app information
Quit: Exit the application
### βοΈ Settings
Auto Wi-Fi Toggle: Enable/disable automatic Wi-Fi management
Launch at Login: Start ToggleWiFi automatically when you log in
Language Selection: Choose between English and German
Connection Status: Real-time Ethernet and Wi-Fi status display
### π Localization
ToggleWiFi supports multiple languages:
- πΊπΈ English (Default)
- π©πͺ German (Deutsch)
### Adding New Languages
1. Create a new .lproj folder for your language
2. Add translated Localizable.strings file
3. Update the language list in SettingsView.swift
### π§ Technical Details
#### Architecture
- SwiftUI: Modern declarative UI framework
- Network Framework: Real-time network monitoring
- UserNotifications: Native macOS notifications
- ServiceManagement: Launch at login functionality
#### Key Components
- `MenuBarManager`: Handles menu bar interactions and notifications
- `NetworkMonitor`: Monitors Ethernet connection status
- `WiFiManager`: Controls Wi-Fi interface via networksetup
- `LocalizationManager`: Manages app localization
- `SettingsView`: Configuration interface
#### Permissions
The app requires:
- Network client entitlement for monitoring connections
- Apple Events automation for system interaction
- App sandbox disabled for network interface control
### π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
#### Development Setup
1. Fork the repository
1. Create a feature branch (git checkout -b feature/AmazingFeature)
1. Commit your changes (git commit -m 'Add some AmazingFeature')
1. Push to the branch (git push origin feature/AmazingFeature)
1. Open a Pull Request
#### Code Guidelines
- Follow Swift style guidelines
- Maintain localization for all user-facing strings
- Test on multiple macOS versions
- Document new features
### π Bug Reports
If you encounter any issues, please create an issue on GitHub with:
- macOS version
- Steps to reproduce
- Expected vs actual behavior
- Console logs (if applicable)
### π License
This project is licensed under the MIT License - see the LICENSE file for details.
### π Acknowledgments
- Apple's Network Framework documentation
- SwiftUI community resources
- macOS development community
### π Support
- π§ Create an issue on GitHub
- π¬ Start a discussion in the repository
- β Star the project if you find it useful!