mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-15 06:32:40 +00:00
Working on launch agents
This commit is contained in:
29
macOS/LaunchAgents/com.michael.clear-screenshots.plist
Normal file
29
macOS/LaunchAgents/com.michael.clear-screenshots.plist
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?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.micheal.clear-screenshots</string>
|
||||||
|
<key>ProgramArguments</key>
|
||||||
|
<array>
|
||||||
|
<string>sh</string>
|
||||||
|
<string>-c</string>
|
||||||
|
<string>/Users/michael/.local/scripts/clear_screenshots</string>
|
||||||
|
</array>
|
||||||
|
<key>StartCalendarInterval</key>
|
||||||
|
<dict>
|
||||||
|
<key>Day</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
<key>Hour</key>
|
||||||
|
<integer>0</integer>
|
||||||
|
<key>Minute</key>
|
||||||
|
<integer>0</integer>
|
||||||
|
<key>Weekday</key>
|
||||||
|
<integer>0</integer>
|
||||||
|
</dict>
|
||||||
|
<key>UserName</key>
|
||||||
|
<string>michael</string>
|
||||||
|
<key>RunAtLoad</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
20
scripts/install_launch_agents
Executable file
20
scripts/install_launch_agents
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Installs launchd agents for appropriately.
|
||||||
|
|
||||||
|
agent="$HOME/Library/LaunchAgents"
|
||||||
|
uid="$(id -u "$(whoami)")"
|
||||||
|
|
||||||
|
test -d "$agent"
|
||||||
|
|
||||||
|
for file in "$DOTFILES"/macOS/LaunchAgents/*.plist; do
|
||||||
|
filename="$(basename $file)"
|
||||||
|
path="$agent/$filename"
|
||||||
|
if ! test -e "$path"; then
|
||||||
|
echo "Installing Agent: $filename"
|
||||||
|
cp "$file" "$path"
|
||||||
|
launchctl enable "user/$uid/$filename"
|
||||||
|
fi
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user