Thanks to visit codestin.com
Credit goes to github.com

Skip to content

πŸ”Œ Intelligent macOS menu bar application that automatically toggles Wi-Fi based on Ethernet connection status. Built with SwiftUI and supports multiple languages.

License

Notifications You must be signed in to change notification settings

yangruixuan/ToggleWifi

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ToggleWiFi

Platform Language Framework License macOS Version

πŸ”Œ 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

Workflow Diagram

Settings Screen

English

Settings English

German

Settings German

Menubar

App Menubar

Notifications upon status change

Notifications


πŸ–₯️ 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
  git clone https://github.com/fahidnasir/ToggleWiFi.git
  cd ToggleWiFi
  1. Open in Xcode
  open ToggleWiFi.xcodeproj
  1. 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
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. 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!

Made with ❀️ for the macOS community

Report Bug Β· Request Feature

About

πŸ”Œ Intelligent macOS menu bar application that automatically toggles Wi-Fi based on Ethernet connection status. Built with SwiftUI and supports multiple languages.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 94.6%
  • Shell 5.4%