From 335109c800592e9d6ea64c1364a05ca8fcacf35e Mon Sep 17 00:00:00 2001 From: Din Tort Date: Mon, 27 Oct 2025 20:57:06 +0100 Subject: [PATCH] refactor(macos): Improve solaar executable lookup in launchagent script This change improves how the `create-macos-launchagent.sh` script locates the `solaar` executable. Previously, the script defaulted to a hardcoded path (`/opt/homebrew/bin/solaar`) and would exit with an error if that specific file was not found and executable. This was too restrictive and failed in environments where `solaar` is installed in a different location, such as through `pipx` or in standard system paths like `/usr/local/bin`. Now, the script defaults the `SOLAAR_PATH` to just `solaar` and uses the `command -v` utility to find the executable in the user's `PATH`. This allows the system to resolve the correct location of the `solaar` binary automatically. If the executable cannot be found in the `PATH`, the script now issues a warning instead of exiting, and proceeds to use the provided `SOLAAR_PATH` value in the generated LaunchAgent plist. This makes the script more flexible and robust for different installation methods. --- tools/create-macos-launchagent.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/create-macos-launchagent.sh b/tools/create-macos-launchagent.sh index 7058de37..417c81c3 100755 --- a/tools/create-macos-launchagent.sh +++ b/tools/create-macos-launchagent.sh @@ -28,7 +28,7 @@ cat > "${LAUNCH_AGENT_PLIST}" <io.github.pwr-solaar.solaar ProgramArguments - ${SOLAAR_PATH} + ${SOLAAR_RESOLVED_PATH} --window=hide RunAtLoad