View runAsUser.sh
#!/bin/sh | |
# template script for running a command as user | |
# The presumption is that this script will be executed as root from a launch daemon | |
# or from some management agent. To execute a single command as the current user | |
# you can use the `runAsUser` function below. | |
# by Armin Briegel - Scripting OS X | |
# |
View pkgAndNotarize.sh
#!/bin/zsh | |
# pkgAndNotarize.sh | |
# 2019 - Armin Briegel - Scripting OS X | |
# place a copy of this script in in the project folder | |
# when run it will build for installation, | |
# create a pkg from the product, | |
# upload the pkg for notarization and monitor the notarization status |
View bash_prompt.sh
# PROMPT | |
# default macOS prompt is: \h:\W \u\$ | |
# assemble the prompt string PS1 | |
# inspired from: https://stackoverflow.com/a/16715681 | |
function __build_prompt { | |
local EXIT="$?" # store current exit code | |
# define some colors |
View InstallerBuilds.sh
#!/bin/bash | |
export PATH=/usr/bin:/bin:/usr/sbin:/sbin | |
installerBuildVersion() { # $1 path to the installer app | |
installerApp=${1:?"no path for installer"} | |
# echo "inspecting: $installerApp" | |
if [[ -d "$installerApp" ]]; then | |
identifier=$(/usr/libexec/PlistBuddy -c "print CFBundleIdentifier" "$installerApp/Contents/Info.plist") |
View checkmembers.sh
#!/bin/bash | |
export PATH=/usr/bin:/bin:/usr/sbin:/sbin | |
# checkusers | |
# | |
# written by Armin Briegel, Scripting OS X, 2018 | |
# | |
# code is provided as is, with no guarantees that it will work etc. | |
# adapt and use as you will |
View allusers.sh
#!/bin/bash | |
export PATH=/usr/bin:/bin:/usr/sbin:/sbin | |
# allusers.sh | |
# | |
# written by Armin Briegel, Scripting OS X, 2018 | |
# | |
# code is provided as is, with no guarantees that it will work etc. | |
# adapt and use as you will |
View userpictures.sh
#!/bin/bash | |
# create an array from all images in the User Pictures subfolders | |
IFS=$'\n' read -rd '' -a pictures <<< "$(find '/Library/User Pictures/Fun' -name *.tif -print )" | |
# loop through all users | |
picIndex=0 |
View setdesktop.sh
#!/bin/sh | |
## | |
## sets the desktop using `desktoppr` | |
## | |
export PATH=/usr/bin:/bin:/usr/sbin:/sbin | |
# set the path to the desktop image file here | |
picturepath="/Library/Desktop Pictures/BoringBlueDesktop.png" |
View com.scriptingosx.setdesktop.plist
<?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.scriptingosx.setdesktop</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/local/bin/desktoppr</string> | |
<string>/Library/Desktop Pictures/BoringBlueDesktop.png</string> |
View desktop_picture_boringblue.mobileconfig
<?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>PayloadContent</key> | |
<array> | |
<dict> | |
<key>PayloadDisplayName</key> | |
<string>Desktop</string> | |
<key>PayloadEnabled</key> |
NewerOlder