Giter Site home page Giter Site logo

offwifisleep's Introduction

offWiFiSleep

Turn Wi-Fi service off on sleep, back on when wake up. 当Mac进入睡眠的时候,关闭WiFi服务,这样可以避免系统服务在睡眠时访问网络。有助于省电。 当再次唤醒的时候,自动打开WiFI服务。

打包

请参考createpkg目录的脚本

安装

设计的**是,将所有的文件都安装在/Library/Application Support/offWifiSleep文件夹中,并利用LaunchDaemon来启动服务。

卸载

为了方便卸载,最直接的方法是执行下面的命令:

sudo "/Library/Application Support/offWifiSleep/uninstall.sh"

禁止/开启

有的时候你可能需要禁止这个操作,而又不想从系统中彻底卸载它,那么可以运行下面的命令:

sudo launchctl unload -w /Library/LaunchDaemons/com.github.TonyLiu2ca.offWiFiSleep.plist

再次开启的命令是:

sudo launchctl load -w /Library/LaunchDaemons/com.github.TonyLiu2ca.offWiFiSleep.plist

注:当运行上述命令的时候,它可能会询问当前管理员帐户的密码,以便提升权限进行修改

说明

本程序利用了sleepwatch 2.2来实现睡眠和唤醒的系统调用

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.