Skip to content

Fix sketchybar invocation to work with non-Homebrew installs#5

Open
klockeph wants to merge 1 commit into
malpern:mainfrom
klockeph:pk/fix-nix-path
Open

Fix sketchybar invocation to work with non-Homebrew installs#5
klockeph wants to merge 1 commit into
malpern:mainfrom
klockeph:pk/fix-nix-path

Conversation

@klockeph
Copy link
Copy Markdown

URL(fileURLWithPath: sketchybarPath) only works when the binary is at a hardcoded well-known Homebrew path. That is because URL only works with full paths, not with just "sketchybar", which is the default argument if the detection logic fails.

Users on Nix, MacPorts, or any other package manager have sketchybar on their $PATH but not at /opt/homebrew or /usr/local, so the process would launch the wrong path or fail entirely. Drop the path-guessing logic and always invoke via /usr/bin/env so the system $PATH is used to resolve the binary regardless of how it was installed.

(Tested with nix)

URL(fileURLWithPath: sketchybarPath) only works when the binary is at a
hardcoded well-known Homebrew path. Users on Nix, MacPorts, or any other
package manager have sketchybar on their PATH but not at /opt/homebrew or
/usr/local, so the process would launch the wrong path or fail entirely.
Drop the path-guessing logic and always invoke via /usr/bin/env so the
system PATH is used to resolve the binary regardless of how it was installed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant