Last active
November 16, 2020 20:07
-
-
Save Wartz/351dfb2f936f02725687c99882958f38 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
loggedInUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ && ! /loginwindow/ { print $3 }' ) | |
/bin/cat << EOF > "/Users/$loggedInUser/Library/LaunchAgents/com.myorg.myapp.plist" | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.google.Chrome.app.chfbpgnooceecdoohagngmjnndbbaeip</string> | |
<key>KeepAlive</key> | |
<true/> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/Users/$loggedInUser/Applications/Chrome Apps.localized/Google Chat.app/Contents/MacOS/app_mode_loader</string> | |
</array> | |
</dict> | |
</plist> | |
EOF | |
exit $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment