Initial commit
authorJacob Casper <dev@jacobcasper.com>
Fri, 15 Jan 2021 15:33:09 +0000 (09:33 -0600)
committerJacob Casper <dev@jacobcasper.com>
Fri, 15 Jan 2021 15:33:09 +0000 (09:33 -0600)
Makefile [new file with mode: 0644]
com.jacobcasper.pm.off.plist [new file with mode: 0644]
com.jacobcasper.pm.on.plist [new file with mode: 0644]
pm.sh [new file with mode: 0755]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
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 (file)
index 0000000..ecef86a
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>Label</key>
+    <string>com.jacobcasper.pm.off</string>
+    <key>ProgramArguments</key>
+    <array>
+       <string>/usr/local/bin/pm.sh</string>
+       <string>0</string>
+    </array>
+    <key>StartCalendarInterval</key> 
+    <dict> 
+        <key>Hour</key> 
+        <integer>18</integer> 
+        <key>Minute</key> 
+        <integer>0</integer> 
+    </dict>
+</dict>
+</plist>
diff --git a/com.jacobcasper.pm.on.plist b/com.jacobcasper.pm.on.plist
new file mode 100644 (file)
index 0000000..da2be6e
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>Label</key>
+    <string>com.jacobcasper.pm.on</string>
+    <key>ProgramArguments</key>
+    <array>
+       <string>/usr/local/bin/pm.sh</string>
+       <string>1</string>
+    </array>
+    <key>StartCalendarInterval</key> 
+    <dict> 
+        <key>Hour</key> 
+        <integer>8</integer> 
+        <key>Minute</key> 
+        <integer>45</integer> 
+    </dict>
+</dict>
+</plist>
diff --git a/pm.sh b/pm.sh
new file mode 100755 (executable)
index 0000000..a5bfe3a
--- /dev/null
+++ b/pm.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+echo $1
+pmset -a disablesleep $1