3/22/2023 0 Comments Sleepwatcher scripts![]() Set timeout for the -i option (in 0.1 seconds)Įxecute idlecommand when no user interaction (keyboard, mouse) (sleepcommand must not take longer than 15 seconds becauseĪfter this timeout the sleep mode is forced by the system)Įxecute wakeupcommand when the Mac wakes upĮxecute displaydimcommand when the display of the Mac is dimmedĮxecute displayundimcommand when the display of the Mac is undimmedĮxecute displaysleepcommand when the display of the Mac is put toĮxecute displaywakeupcommand when the display of the Mac wakes up That previously was allowed via the -a option, but vetoed by an otherĮxecute sleepcommand when the Mac is put to sleep mode (note: no space between -a and the optional allowsleepcommand)Įxecute cantsleepcommand when the Mac retracts an attempt to sleep that (later, SIGHUP causes reconfiguration from a modified configfile)Īllow the Mac to sleep only when allowsleepcommand returns a zeroĮxit code, -a without allowsleepcommand denys sleeping Read additional configuration parameters from configfile Print the time of no keyboard or mouse activity (in 0.1 seconds) Run as a background daemon (don't use -d in conjunction with launchd) Sleep now and exit, ignoring other optionsĭisplay version and copyright information and exit Und hier ein Beispiel für die Dateien welche das Programm aufrufen.ĭaemon to monitor sleep, wakeup and idleness of the Mac Sudo chmod +x /etc/rc.sleep /etc/rc.wakeup Alles anzeigen # create script in local user directory and make them executable Sudo launchctl load -w -F /Library/LaunchDaemons/de. Sudo cp config/de. /Library/LaunchDaemons/de. Sudo cp sleepwatcher.8 /usr/local/share/man/man8 ![]() Sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8 # create folders necessary for installation Tar xvzf sleepwatcher_2.2.tgz 2>/dev/null # download sleepwatcher package, untar, and cd into directory Sudo rm -f /usr/local/share/man/man8/sleepwatcher.8 Launchctl unload ‾/Library/LaunchAgents/de. 2>/dev/null Sudo launchctl unload /Library/LaunchDaemons/de. 2>/dev/null While true do sudo -n true sleep 60 kill -0 "$$" || exit done 2>/dev/null & ![]() # Keep-alive: update existing `sudo` time stamp until `.osx` has finished Und wenn man es vergisst läuft man Gefahr, dass der Rechner irgendwann zu heiss wird da die Sensoren nicht mehr ausgelesen werden. Ihn jedesmal von Hand zu beenden und neu zu starten war mir irgendwann aber zu blöd. Dieser scheint manchmal nicht mehr richtig zu klappen nach dem Aufwachen. Das gleiche mache ich mit dem HWMonitor welcher auf unseren T61(p) sehr wichtig ist. Und so wird sie unterbrochen vor dem Sleep und beim Aufwachen wieder hergestellt. Macht man das nicht hat man jedesmal nach dem Aufwachen eine Fehlermeldung, dass die VPN-Verbindung unterbrochen wurde. eine VPN-Verbindung vor dem Sleep zu beenden. Das Tool was ich verwende arbeitet in der Shell und ist somit äußerst schlank und an Resourcen benötigt es so gut wie gar nichts.Īuf meinem Rechner nutze ich es dafür um z.b. Das sind aber GUI-Lösungen und zudem noch kostenpflichtig. Sicherlich gibts hier bereits schon Programme für. Damit kann man Aktionen ausführen wenn man den Rechner in den Sleep schickt bzw. Ich habe mir gestern auf meinem T61p ein kleines Tool installiert.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |