From c24560933c6ba50f60fca473e7d3e6c2ea07ea18 Mon Sep 17 00:00:00 2001 From: Jacob Casper Date: Fri, 15 Jan 2021 09:33:09 -0600 Subject: [PATCH] Initial commit --- Makefile | 8 ++++++++ com.jacobcasper.pm.off.plist | 20 ++++++++++++++++++++ com.jacobcasper.pm.on.plist | 20 ++++++++++++++++++++ pm.sh | 3 +++ 4 files changed, 51 insertions(+) create mode 100644 Makefile create mode 100644 com.jacobcasper.pm.off.plist create mode 100644 com.jacobcasper.pm.on.plist create mode 100755 pm.sh diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8df8055 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +install: + cp com.jacobcasper.pm* /Library/LaunchDaemons + ln -s $(shell pwd)/pm.sh /usr/local/bin/pm.sh + launchctl load -w /Library/LaunchDaemons/com.jacobcasper.pm.o* +uninstall: + rm -f /Library/LaunchDaemons/com.jacobcasper.pm* + rm -f /usr/local/bin/pm.sh + launchctl unload -w /Library/LaunchDaemons/com.jacobcasper.pm.o* diff --git a/com.jacobcasper.pm.off.plist b/com.jacobcasper.pm.off.plist new file mode 100644 index 0000000..ecef86a --- /dev/null +++ b/com.jacobcasper.pm.off.plist @@ -0,0 +1,20 @@ + + + + + Label + com.jacobcasper.pm.off + ProgramArguments + + /usr/local/bin/pm.sh + 0 + + StartCalendarInterval + + Hour + 18 + Minute + 0 + + + diff --git a/com.jacobcasper.pm.on.plist b/com.jacobcasper.pm.on.plist new file mode 100644 index 0000000..da2be6e --- /dev/null +++ b/com.jacobcasper.pm.on.plist @@ -0,0 +1,20 @@ + + + + + Label + com.jacobcasper.pm.on + ProgramArguments + + /usr/local/bin/pm.sh + 1 + + StartCalendarInterval + + Hour + 8 + Minute + 45 + + + diff --git a/pm.sh b/pm.sh new file mode 100755 index 0000000..a5bfe3a --- /dev/null +++ b/pm.sh @@ -0,0 +1,3 @@ +#!/bin/sh +echo $1 +pmset -a disablesleep $1 -- 2.20.1