diff --git a/ff2mpv b/ff2mpv index fd10d56..a588710 100755 --- a/ff2mpv +++ b/ff2mpv @@ -13,12 +13,12 @@ args.push(*options) # HACK(ww): On macOS, graphical applications inherit their path from `launchd` # rather than the default path list in `/etc/paths`. `launchd` doesn't include -# `/usr/local/bin` in its default list, which means that any installations +# Homebrew in its default list, which means that any installations # of MPV and/or youtube-dl under that prefix aren't visible when spawning # from, say, Firefox. The real fix is to modify `launchd.conf`, but that's # invasive and maybe not what users want in the general case. # Hence this nasty hack. -ENV["PATH"] = "/usr/local/bin:/opt/homebrew/bin:#{ENV['PATH']}" if RUBY_PLATFORM =~ /darwin/ +ENV["PATH"] = "/opt/homebrew/bin:/usr/local/bin:#{ENV['PATH']}" if RUBY_PLATFORM =~ /darwin/ pid = spawn "mpv", *args, "--", url, in: :close, out: "/dev/null", err: "/dev/null" diff --git a/ff2mpv.py b/ff2mpv.py index 01a0353..b0eb4f0 100755 --- a/ff2mpv.py +++ b/ff2mpv.py @@ -22,14 +22,14 @@ def main(): # HACK(ww): On macOS, graphical applications inherit their path from `launchd` # rather than the default path list in `/etc/paths`. `launchd` doesn't include - # `/usr/local/bin` in its default list, which means that any installations + # Homebrew in its default list, which means that any installations # of MPV and/or youtube-dl under that prefix aren't visible when spawning # from, say, Firefox. The real fix is to modify `launchd.conf`, but that's # invasive and maybe not what users want in the general case. # Hence this nasty hack. if platform.system() == "Darwin": path = os.environ.get("PATH") - os.environ["PATH"] = f"/usr/local/bin:/opt/homebrew/bin:{path}" + os.environ["PATH"] = f"/opt/homebrew/bin:/usr/local/bin:{path}" subprocess.Popen(args, **kwargs)