Sync macOS Photos library to digital photo frames.
Install Python via pyenv
, configured with support for shared libraries. Without this, we will not be able to use pyinstaller
.
PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.10.2
Install ImageMagick via brew
brew install imagemagick
Build the peopleframe
binary
poetry run pyinstaller ./peopleframe.spec
Install the peopleframe
binary somewhere static, e.g.
mv dist/peopleframe ~/bin
Note that apparently using
cp
do this triggers a kernel bug where the previously-cached metadata for the
old binary will be used, causing the new one to fail signature checks. Using
mv
works around this. Presumably a reboot would as well?
Install a launch agent.
To do this, we are going to use the in.std.peopleframe.XXXXX.plist
file as a
template so that we can, e.g. run multiple instances of peopleframe
synchronizing different albums at different frequencies. Update it as follows
-
Pick a unique filename by replacing
XXXXX
. In the rest of this example we useLABEL
. Make sure that theLabel
property in the plist matches as well as any paths in other keys likeStandardErrorPath
. Make sure that the directories referenced in the various paths exist. -
Set the first element of the
ProgramArguments
array to the path where you installed thepeopleframe
binary, e.g.
<key>ProgramArguments</key>
<array>
<string>/Users/pg/bin/peopleframe</string>
...
</array>
- Copy the resulting
in.std.peopleframe.LABEL.plist
file to~/Library/LaunchAgents
cp in.std.peopleframe.LABEL.plist ~/Library/LaunchAgents
- Load the agent
launchctl bootstrap gui/$UID/ ~/Library/LaunchAgents/in.std.peopleframe.LABEL.plist
To update in.std.peopleframe.plist
do this
launchctl bootout gui/$UID/ ~/Library/LaunchAgents/in.std.peopleframe.plist
cp in.std.peopleframe.plist ~/Library/LaunchAgents
launchctl bootstrap gui/$UID/ ~/Library/LaunchAgents/in.std.peopleframe.plist
To show details about the agent
launchctl print gui/$UID/in.std.peopleframe
To build the binary
poetry run pyinstaller peopleframe.spec
This spec file was generated as a by-product of running the following. Without
the extra --collect-all
options, various resources were missing.
pyinstaller \
-Fc --collect-all osxphotos --collect-all photoscript \
./peopleframe/main.py