matryer / xbar

Put the output from any script or program into your macOS Menu Bar (the BitBar reboot)
https://xbarapp.com
MIT License
17.49k stars 643 forks source link

How to solve exec format error in v2.1.7-beta #851

Closed avorio closed 1 year ago

avorio commented 1 year ago

Hello there,

First of all, thanks for such a cool app concept! It's great.

I installed v2.1.7-beta and then a couple of plugins. None of them is actually working. So, instead of troubleshooting their code, I thought: let's try creating a new hello-world-type plugin to test things out. That didn't work either.

I placed the code below in a file within the plugins/ folder:

#!/Users/andre/.pyenv/shims/python3

# -*- coding: utf-8 -*-
# <xbar.title>Avorio</xbar.title>
# <xbar.version>1.0</xbar.version>
# <xbar.author>Avorio</xbar.author>
# <xbar.author.github>avorio</xbar.author.github>
# <xbar.desc>Test</xbar.desc>
# <xbar.image></xbar.image>

print("hello :)")

At first, I got an error message complaining that the file wasn't executable. I did chmod +x and sorted that out. However, how I'm getting a different error message in the menu bar. It reads:

fork/exec ./001-avorio.10m.py: exec format error

What's going on? How can I get out of this?

Many thanks!

avorio commented 1 year ago

The solution was to change the shebang to:

#!/opt/homebrew/bin/python3.8