-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sh
28 lines (26 loc) · 863 Bytes
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
var=$USER
launchctl unload -w /Users/$var/Library/LaunchAgents/DynamicWalls.Scheduler.plist
DIR="$(pwd)"
echo "<?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>DynamicWalls.Scheduler</string>
<key>Program</key>
<string>/usr/bin/osascript</string>
<key>ProgramArguments</key>
<array>
<string>osascript</string>
<string>$DIR/wallpaper.scpt</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StartInterval</key>
<integer>10</integer>
</dict>
</plist>" > /Users/$var/Library/LaunchAgents/DynamicWalls.Scheduler.plist
launchctl load -w /Users/$var/Library/LaunchAgents/DynamicWalls.Scheduler.plist