lazywen
V2EX  ›  macOS

有没有办法让 Mac 在睡眠唤醒时自动运行一个东西

  •  
  •   lazywen · Apr 1, 2015 · 7000 views
    This topic created in 4080 days ago, the information mentioned may be changed or developed.
    如题,想在系统睡眠唤醒后马上运行一个脚本,又不能使用crontab定时运行(会影响正常使用),搜了半天没有找到,各位有没有什么办法😪😪
    9 replies    2015-04-03 05:21:37 +08:00
    582033
        1
    582033  
       Apr 1, 2015
    是不是可以在osx10.10.1版本,然后检测下是否能正常ping通baidu来判断...
    同学,要充分利用版本特性
    zieglar
        3
    zieglar  
       Apr 1, 2015   ❤️ 2
    brew install sleepwatcher
    huashengluban
        4
    huashengluban  
       Apr 1, 2015   ❤️ 1
    我是用键盘大师实现的
    Themyth
        5
    Themyth  
       Apr 1, 2015
    可以做什么用么?
    @johnnyjiangyc
    @zieglar
    lzsc123
        6
    lzsc123  
       Apr 1, 2015   ❤️ 1
    前段时间遇到同样的问题,哈哈,最后通过这个软件实现了的。ControlPlane 免费的哦。http://www.controlplaneapp.com/

    以下是付费解决方案
    Scenario
    Power Manager
    CDuXZMAPgHp1q9ew
        7
    CDuXZMAPgHp1q9ew  
       Apr 1, 2015   ❤️ 1
    sleepwatcher

    一键安装脚本
    http://tyhoffman.com/blog/2013/09/sleepwatcher-power-event-driven-automation/

    sudo sh sleepwatcher.sh

    然后在
    /private/etc/rc.wakeup
    /private/etc/rc.sleep
    写上脚本就行


    开启 MagicanRest
    open /Applications/MagicanRest.app
    关闭 MagicanRest
    ps -ef | grep MagicanRest | awk '{print $2}' | xargs kill
    lazywen
        8
    lazywen  
    OP
       Apr 1, 2015
    @zieglar
    @lzsc123
    @wujichao
    感谢,sleepwatcher能满足需求啦,居然还有这种东西
    xcv58
        9
    xcv58  
       Apr 3, 2015
    想省事的话用 EventScripts 吧。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   6011 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 02:05 · PVG 10:05 · LAX 19:05 · JFK 22:05
    ♥ Do have faith in what you're doing.