Lima is an alternative to using Docker Desktop on your Mac.

Overview

lima-xbar-plugin

License Awesomebot Superlinter codeql GitHub stars

Table of Contents

Lima is an alternative to using Docker Desktop on your Mac.

Description

This plugin is compatible with xbar and SwiftBar, and provides a menubar app that creates a Lima menubar option with submenus for each Lima VM on your machine. For each VM, you can:

  • start/stop the VM
  • stop, start or remove stopped containers
  • pull or remove images from the VM
  • Run an arbitrary command inside the VM with lima

Screen shots

Screen shot of xbar menu with container submenu for a running vm

Screen shot of xbar menu with image submenu for a running vm

Installation

Copy lima-plugin to ~/Library/Application\ Support/xbar/plugins/lima-plugin.30s, or run make install

Dependencies

  • xbar or SwiftBar - Both allow you to make custom menubar apps with simple scripts.
Comments
  • FileNotFoundError: No such file or directory: '/usr/local/bin/limactl'

    FileNotFoundError: No such file or directory: '/usr/local/bin/limactl'

    I'm getting the following error in xbar:

     [2021-10-09 09:05:07,468][    INFO][lima-plugin:543 -                 main() ] argv[0] ./lima-plugin
    🐋 🏃 | color=#29cc00
    ---
    Traceback (most recent call last):
      File "/Users/salvot/Library/Application Support/xbar/plugins/./lima-plugin", line 567, in <module>
        main()
      File "/Users/salvot/Library/Application Support/xbar/plugins/./lima-plugin", line 545, in main
        xbarMenu()
      File "/Users/salvot/Library/Application Support/xbar/plugins/./lima-plugin", line 526, in xbarMenu
        aboutMenu()
      File "/Users/salvot/Library/Application Support/xbar/plugins/./lima-plugin", line 418, in aboutMenu
        limaVersion = subprocess.run(
      File "/opt/homebrew/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 505, in run
        with Popen(*popenargs, **kwargs) as process:
      File "/opt/homebrew/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File "/opt/homebrew/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
        raise child_exception_type(errno_num, err_msg, err_filename)
    FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/limactl'
    

    I've tried a few permutations of adding /usr/local/bin and /opt/homebrew/bin to the command, as well as checking environment variables.

    Ultimately, I had to symlink lima and limactl into /usr/local/bin. Is this expected, and should this be part of the Makefile?

    opened by buzzsurfr 6
  • The plugin does not work properly if we change the destination of the homebrew installation

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

    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.

    bug enhancement 
    opened by intptr-t 3
  • Logging in Swiftbar

    Logging in Swiftbar

    Hi ! I tried using this plugin in SwiftBar but when it is displayed in the menu bar all of the logging are present, it is not the case when using xbar

    SwiftBar
    opened by Wes974 3
  • Add more candidate directories to be added to $PATH

    Add more candidate directories to be added to $PATH

    Description

    • Bump version to 1.3.3
    • Check for ~/homebrew/bin and ~/homebrew/sbin to cope when homebrew is installed in a user's home directory. Closes https://github.com/unixorn/lima-xbar-plugin/issues/28
    • While we're in there, check for /usr/local/sbin, /opt/homebrew/sbin, /opt/local/sbin, ~/bin and ~/sbin directories too.

    Type of changes

    Checklist

    • [x] All new and existing tests pass.
    • [ ] Any added/updated scripts added use #!/usr/bin/env interpreter instead of potentially platform-specific direct paths (#!/bin/sh and #!/bin/bash are allowed exceptions)
    • [ ] Added/updated scripts are marked executable
    • [ ] Scripts do not have a language file extension unless they are meant to be sourced and not run standalone. No end-user should have to know if a script was written in bash, python, ruby or whatever. Not including file extensions makes it easier to rewrite the script in another language later without having to change every reference to the previous version.
    • [ ] I have confirmed that the link(s) in my PR are valid.

    License Acceptance

    • [x] This repository is Apache version 2.0 licensed (some scripts may have alternate licensing inline in their code) and by making this PR, I am contributing my changes to the repository under the terms of the Apache 2 license.
    opened by unixorn 2
  • Switch to megalinter

    Switch to megalinter

    Description

    • Switch to megalinter.
    • Upload megalinter results as GitHub artifacts

    Checklist

    • [x] All new and existing tests pass.
    • [ ] Any added/updated scripts added use #!/usr/bin/env interpreter instead of potentially platform-specific direct paths (#!/bin/sh and #!/bin/bash are allowed exceptions)
    • [ ] Added/updated scripts are marked executable
    • [ ] Scripts do not have a language file extension unless they are meant to be sourced and not run standalone. No end-user should have to know if a script was written in bash, python, ruby or whatever. Not including file extensions makes it easier to rewrite the script in another language later without having to change every reference to the previous version.
    • [ ] I have confirmed that the link(s) in my PR are valid.

    License Acceptance

    • [x] This repository is Apache version 2.0 licensed (some scripts may have alternate licensing inline in their code) and by making this PR, I am contributing my changes to the repository under the terms of the Apache 2 license.
    opened by unixorn 1
  • Suggestion: use `limactl list --json`

    Suggestion: use `limactl list --json`

    First, thanks a lot for working on this

    https://github.com/unixorn/lima-xbar-plugin/blob/e32889db0b1b7b1d9c8697b75b5be5e6242bddcb/lima-plugin#L71

    The grep above doesn't seem robust, and will probably break soon with a future version of Lima. I'd suggest using limactl list --json and use jq for parsing JSON.

    $ limactl list --json  | jq .
    {
      "name": "default",
      "status": "Running",
      "dir": "/Users/suda/.lima/default",
      "arch": "x86_64",
      "sshLocalPort": 60022,
      "hostAgentPID": 1968,
      "qemuPID": 1972
    }
    
    opened by AkihiroSuda 1
  • Adds black to dev-deps and runs it through poetry

    Adds black to dev-deps and runs it through poetry

    Description

    Previously, the Makefile depended on black being installed in the active Python venv already. This instead lets Poetry manage it, lets the lockfile determine the version, and has the Makefile run it via Poetry.

    Type of changes

    • Adds dev dependency
    • Use that dependency's installed binary in Makefile

    Checklist

    • [X] All new and existing tests pass.
    • [X] Any added/updated scripts added use #!/usr/bin/env interpreter instead of potentially platform-specific direct paths (#!/bin/sh and #!/bin/bash are allowed exceptions)
    • [X] Added/updated scripts are marked executable
    • [X] Scripts do not have a language file extension unless they are meant to be sourced and not run standalone. No end-user should have to know if a script was written in bash, python, ruby or whatever. Not including file extensions makes it easier to rewrite the script in another language later without having to change every reference to the previous version.
    • [X] I have confirmed that the link(s) in my PR are valid.

    License Acceptance

    • [X] This repository is Apache version 2.0 licensed (some scripts may have alternate licensing inline in their code) and by making this PR, I am contributing my changes to the repository under the terms of the Apache 2 license.
    opened by colindean 0
  • Deal with Swiftbar change

    Deal with Swiftbar change

    Description

    Swiftbar now is capturing STDERR in addition to STDOUT, which made all the logging info get spammed to the menubar.

    We now default to log level CRITICAL - log output is only necessary during debugging, so this stifles all log output during normal runs by Swiftbar and Xbar.

    Closes #26

    Type of changes

    Bugfix to cope with Swiftbar changes.

    Checklist

    • [x] All new and existing tests pass.
    • [ ] Any added/updated scripts added use #!/usr/bin/env interpreter instead of potentially platform-specific direct paths (#!/bin/sh and #!/bin/bash are allowed exceptions)
    • [ ] Added/updated scripts are marked executable
    • [ ] Scripts do not have a language file extension unless they are meant to be sourced and not run standalone. No end-user should have to know if a script was written in bash, python, ruby or whatever. Not including file extensions makes it easier to rewrite the script in another language later without having to change every reference to the previous version.
    • [ ] I have confirmed that the link(s) in my PR are valid.

    License Acceptance

    • [x] This repository is Apache version 2.0 licensed (some scripts may have alternate licensing inline in their code) and by making this PR, I am contributing my changes to the repository under the terms of the Apache 2 license.
    opened by unixorn 0
  • Add /opt/homebrew/bin to $PATH when present and a directory

    Add /opt/homebrew/bin to $PATH when present and a directory

    Description

    brew doesn't always use /usr/local/bin any more, and macOS doesn't pass the $PATH from .zshrc/.bashrc to GUI applications which caused problems with a brew-installed version of lima.

    prep_environment_for_lima() now adds a list of potential directories to $PATH if they exist and are directories - currently /usr/local/bin, /opt/homebrew/bin and /opt/local/bin.

    Closes https://github.com/unixorn/lima-xbar-plugin/issues/24

    Type of changes

    Bugfix

    Checklist

    • [x] All new and existing tests pass.
    • [x] Any added/updated scripts added use #!/usr/bin/env interpreter instead of potentially platform-specific direct paths (#!/bin/sh and #!/bin/bash are allowed exceptions)
    • [x] Added/updated scripts are marked executable
    • [x] Scripts do not have a language file extension unless they are meant to be sourced and not run standalone. No end-user should have to know if a script was written in bash, python, ruby or whatever. Not including file extensions makes it easier to rewrite the script in another language later without having to change every reference to the previous version.
    • [ ] I have confirmed that the link(s) in my PR are valid.

    License Acceptance

    • [x] This repository is Apache version 2.0 licensed (some scripts may have alternate licensing inline in their code) and by making this PR, I am contributing my changes to the repository under the terms of the Apache 2 license.
    opened by unixorn 0
  • Add option to run arbitrary lima commands

    Add option to run arbitrary lima commands

    Description

    • Add option to run arbitrary commands via lima in a VM
    • Fix some places where vm was set to default and not the actual vm name

    Type of changes

    Checklist

    • [x] All new and existing tests pass.
    • [x] Any added/updated scripts added use #!/usr/bin/env interpreter instead of potentially platform-specific direct paths (#!/bin/sh and #!/bin/bash are allowed exceptions)
    • [x] Added/updated scripts are marked executable
    • [x] Scripts do not have a language file extension unless they are meant to be sourced and not run standalone. No end-user should have to know if a script was written in bash, python, ruby or whatever. Not including file extensions makes it easier to rewrite the script in another language later without having to change every reference to the previous version.
    • [ ] I have confirmed that the link(s) in my PR are valid.

    License Acceptance

    • [x] This repository is Apache version 2.0 licensed (some scripts may have alternate licensing inline in their code) and by making this PR, I am contributing my changes to the repository under the terms of the Apache 2 license.
    opened by unixorn 0
  • Add option to pull a new image

    Add option to pull a new image

    Description

    We can now pull new images, not just pull existing ones.

    Closes https://github.com/unixorn/lima-xbar-plugin/issues/17

    Checklist

    • [x] All new and existing tests pass.
    • [x] Any added/updated scripts added use #!/usr/bin/env interpreter instead of potentially platform-specific direct paths (#!/bin/sh and #!/bin/bash are allowed exceptions)
    • [x] Added/updated scripts are marked executable
    • [x] Scripts do not have a language file extension unless they are meant to be sourced and not run standalone. No end-user should have to know if a script was written in bash, python, ruby or whatever. Not including file extensions makes it easier to rewrite the script in another language later without having to change every reference to the previous version.
    • [x] I have confirmed that the link(s) in my PR are valid.

    License Acceptance

    • [x] This repository is Apache version 2.0 licensed (some scripts may have alternate licensing inline in their code) and by making this PR, I am contributing my changes to the repository under the terms of the Apache 2 license.
    opened by unixorn 0
Releases(v1.3.3)
  • v1.3.3(Feb 27, 2022)

    What's Changed

    • Deal with Swiftbar change by @unixorn in https://github.com/unixorn/lima-xbar-plugin/pull/27
    • Add issue templates by @unixorn in https://github.com/unixorn/lima-xbar-plugin/pull/29
    • Switch to megalinter by @unixorn in https://github.com/unixorn/lima-xbar-plugin/pull/31
    • Add more candidate directories to be added to $PATH by @unixorn in https://github.com/unixorn/lima-xbar-plugin/pull/30

    Full Changelog: https://github.com/unixorn/lima-xbar-plugin/compare/v1.3.1...v1.3.3

    Source code(tar.gz)
    Source code(zip)
  • v1.3.1(Oct 11, 2021)

    brew doesn't always use /usr/local/bin any more, and macOS doesn't pass the $PATH from .zshrc/.bashrc to GUI applications which caused problems with a brew-installed version of lima.

    prep_environment_for_lima() now adds a list of potential directories to $PATH if they exist and are directories - currently /usr/local/bin, /opt/homebrew/bin and /opt/local/bin.

    Closes https://github.com/unixorn/lima-xbar-plugin/issues/24

    Source code(tar.gz)
    Source code(zip)
  • v1.3.0(Oct 11, 2021)

  • v1.2.0(Oct 3, 2021)

  • v1.1.1(Oct 3, 2021)

    Rewrite in Python, mainly because the bash code was starting to get too large to work with comfortably, and Python's way more maintainable.

    On top of that, the original bash version was slow, because there were a lot of cases where it was running lima nerdctl XYZ | jq to parse out information about containers and images, and it wasn't caching the output.

    The python version caches the image and container information, and is much faster - 0.355 seconds on my MBP, the shell version takes 17.332 seconds.

    Source code(tar.gz)
    Source code(zip)
Owner
Joe Block
He/Him. I'm a Site Reliability Engineer for @twilio in Denver. I'm not interested in moving. curiousbiped on twitter.
Joe Block
This repository contains code examples and documentation for learning how applications can be developed with Kubernetes

BigBitBus KAT Components Click on the diagram to enlarge, or follow this link for detailed documentation Introduction Welcome to the BigBitBus Kuberne

51 Oct 16, 2022
Coding For Entrepreneurs 100 Jan 01, 2023
Big data on k8s

# microsoft azure # https://docs.microsoft.com/en-us/cli/azure/install-azure-cli az account set --subscription [] az aks get-credentials --resource-g

Luan Moreno 22 Dec 24, 2022
Tencent Yun tools with python

Tencent_Yun_tools 使用 python3.9 + 腾讯云 AccessKey 利用工具 使用之前请先填写config.ini配置文件 Usage python3 Tencent_rce.py -h Scanner python3 Tencent_rce.py -s 生成CSV

<img src="> 13 Dec 20, 2022
Travis CI testing a Dockerfile based on Palantir's remix of Apache Cassandra, testing IaC, and testing integration health of Debian

Testing Palantir's remix of Apache Cassandra with Snyk & Travis CI This repository is to show Travis CI testing a Dockerfile based on Palantir's remix

Montana Mendy 1 Dec 20, 2021
Hw-ci - Hardware CD/CI and Development Container

Hardware CI & Dev Containter These containers were created for my personal hardware development projects and courses duing my undergraduate degree. Pl

Matthew Dwyer 6 Dec 25, 2022
Ajenti Core and stock plugins

Ajenti is a Linux & BSD modular server admin panel. Ajenti 2 provides a new interface and a better architecture, developed with Python3 and AngularJS.

Ajenti Project 7k Jan 03, 2023
Phonebook application to manage phone numbers

PhoneBook Phonebook application to manage phone numbers. How to Use run main.py python file. python3 main.py Links Download Source Code: Click Here M

Mohammad Dori 3 Jul 15, 2022
A little script and trick to make your heroku app run forever without being concerned about dyno hours.

A little script and trick to make your heroku app run forever without being concerned about dyno hours.

Tiararose Biezetta 152 Dec 25, 2022
Copy a Kubernetes pod and run commands in its environment

copypod Utility for copying a running Kubernetes pod so you can run commands in a copy of its environment, without worrying about it the pod potential

Memrise 4 Apr 08, 2022
Spinnaker is an open source, multi-cloud continuous delivery platform for releasing software changes with high velocity and confidence.

Welcome to the Spinnaker Project Spinnaker is an open-source continuous delivery platform for releasing software changes with high velocity and confid

8.8k Jan 07, 2023
pyinfra automates infrastructure super fast at massive scale. It can be used for ad-hoc command execution, service deployment, configuration management and more.

pyinfra automates/provisions/manages/deploys infrastructure super fast at massive scale. It can be used for ad-hoc command execution, service deployme

Nick Barrett 2.1k Dec 29, 2022
A simple python application for running a CI pipeline locally This app currently supports GitLab CI scripts

🏃 Simple Local CI Runner 🏃 A simple python application for running a CI pipeline locally This app currently supports GitLab CI scripts ⚙️ Setup Inst

Tom Stowe 0 Jan 11, 2022
Convenient tool to manage multiple VMs at once using libvirt

Convenient tool to manage multiple VMs at once using libvirt Installing To install the tool and its dependencies: pip install -e . Getting completion

Cedric Bosdonnat 13 Nov 11, 2022
Containerize a python web application

containerize a python web application introduction this document is part of GDSC at the university of bahrain you don't need to follow along, fell fre

abdullah mosibah 1 Oct 19, 2021
Docker Container wallstreetbets-sentiment-analysis

Docker Container wallstreetbets-sentiment-analysis A docker container using restful endpoints exposed on port 5000 "/analyze" to gather sentiment anal

145 Nov 22, 2022
📦 Powerful Package manager which updates plugins & server software for minecraft servers

pluGET A powerful package manager which updates Plugins and Server Software for minecraft servers. Screenshots check all to check installed plugins fo

106 Dec 16, 2022
Ingress patch example by Kustomize

Ingress patch example by Kustomize

Jinu 10 Nov 14, 2022
The leading native Python SSHv2 protocol library.

Paramiko Paramiko: Python SSH module Copyright: Copyright (c) 2009 Robey Pointer 8.1k Jan 04, 2023

docker-compose工程部署时的辅助脚本

okta-cmd Introduction docker-compose 辅助脚本

完美风暴666 4 Dec 09, 2021