Skip to content

The plugin does not work properly if we change the destination of the homebrew installation #28

@intptr-t

Description

@intptr-t

If we have changed the installation destination of homebrew, unable to find limactl.
Is there any better solution?

What's happening

Exception

exit status 1: Traceback (most recent call last):
  File "./lima-plugin", line 600, in <module>
    main()
  File "./lima-plugin”, line 578, in main
    xbarMenu()
  File "./lima-plugin", line 556, in xbarMenu
    vms = listVMs()  
  File "./lima-plugin”, line 256, in listVMs
    vmRaw = subprocess.run(
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py", line 493, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
  FileNotFoundError: [Errno 2] No such file or directory: 'limactl'

image

xbar or swiftbar starts the plugin with PATH as follows:

PATH=/usr/bin:/bin:/usr/sbin:/sbin

My installation directory of homebrew:

% brew --prefix
/Users/${USER}/homebrew

lima-xbar-plugin cannot call limactl because brew --prefix cannot be used.

Temporary workaround

Add the homebrew/bin path directly to extrapaths

extrapaths = ["/usr/local/bin", "/opt/homebrew/bin", "/opt/local/bin", "/Users/${USER}/homebrew/bin"]

Expected results

The path of homebrew/bin is automatically resolved and limactl can be called.
Then xbar or swiftbar will not generate any errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions