diff --git a/README.md b/README.md index 04f108130..d54e7e30e 100644 --- a/README.md +++ b/README.md @@ -62,8 +62,11 @@ The current suggested toolchain to build the project is Swift 6.1.2 / Xcode 16.4 > [!NOTE] > This project's configuration is heavily based on many environment variables. > -> You can use tools like [EnvPane](https://github.com/hschmidt/EnvPane/releases/) or [MenuHelper](https://github.com/Kyle-Ye/MenuHelper/releases) -> on macOS platform to manage the environment variable more easily. +> You can use the following tools on macOS platform to manage the environment variable more easily. +> +> - [EnvPane](https://github.com/hschmidt/EnvPane/releases/): A macOS preference pane for environment variables +> - [MenuHelper](https://github.com/Kyle-Ye/MenuHelper/releases): A Finder Extension App to improve your efficiency. +> - launchctl via `Scripts/sync_launchagent.sh` ## Supported platforms diff --git a/Scripts/org.openswiftuiproject.openswiftui.environment.plist b/Scripts/org.openswiftuiproject.openswiftui.environment.plist new file mode 100644 index 000000000..bd3597d2d --- /dev/null +++ b/Scripts/org.openswiftuiproject.openswiftui.environment.plist @@ -0,0 +1,18 @@ + + + + + Label + org.openswiftuiproject.openswiftui + ProgramArguments + + sh + -c + +launchctl setenv OPENSWIFTUI_DEVELOPMENT 1; + + + RunAtLoad + + + \ No newline at end of file diff --git a/Scripts/sync_launchagent.sh b/Scripts/sync_launchagent.sh new file mode 100755 index 000000000..edcf2c0be --- /dev/null +++ b/Scripts/sync_launchagent.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -e + +PLIST_SRC="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/org.openswiftuiproject.openswiftui.environment.plist" +PLIST_DEST="$HOME/Library/LaunchAgents/org.openswiftuiproject.openswiftui.environment.plist" + +mkdir -p "$HOME/Library/LaunchAgents" +cp "$PLIST_SRC" "$PLIST_DEST" +echo "Synced $PLIST_SRC to $PLIST_DEST" + +# launchctl load $PLIST_DEST