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
📦 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
MagTape is a Policy-as-Code tool for Kubernetes that allows for evaluating Kubernetes resources against a set of defined policies to inform and enforce best practice configurations.

MagTape is a Policy-as-Code tool for Kubernetes that allows for evaluating Kubernetes resources against a set of defined policies to inform and enforce best practice configurations. MagTape includes

T-Mobile 143 Dec 27, 2022
Inferoxy is a service for quick deploying and using dockerized Computer Vision models.

Inferoxy is a service for quick deploying and using dockerized Computer Vision models. It's a core of EORA's Computer Vision platform Vision Hub that runs on top of AWS EKS.

94 Oct 10, 2022
CTF infrastructure deployment automation tool.

CTF infrastructure deployment automation tool. Focus on the challenges. Mirrored from

Fake News 1 Apr 12, 2022
This Docker container is build to run on a server an provide an easy to use interface for every student to vote for their councilors

This Docker container is build to run on a server and provide an easy to use interface for every student to vote for their councilors.

Robin Adelwarth 7 Nov 23, 2022
ServerStatus 云探针、多服务器探针、云监控、多服务器云监控

ServerStatus 云探针、多服务器探针、云监控、多服务器云监控 基于ServerStatus-Hotaru膜改版的套娃膜改版(实际上本README也是抄它的)。 主要将client改为通过http提交数据,以及将服务端换成了php以便减小部署成本(PHP is the best!) 默认图片

shirakun 16 Apr 14, 2022
IP address management (IPAM) and data center infrastructure management (DCIM) tool.

NetBox is an IP address management (IPAM) and data center infrastructure management (DCIM) tool. Initially conceived by the network engineering team a

NetBox Community 11.8k Jan 07, 2023
Rundeck / Grafana / Prometheus / Rundeck Exporter integration demo

Rundeck / Prometheus / Grafana integration demo via Rundeck Exporter This is a demo environment that shows how to monitor a Rundeck instance using Run

Reiner 4 Oct 14, 2022
DC/OS - The Datacenter Operating System

DC/OS - The Datacenter Operating System The easiest way to run microservices, big data, and containers in production. What is DC/OS? Like traditional

DC/OS 2.3k Jan 06, 2023
Dockerized service to backup all running database containers

Docker Database Backup Dockerized service to automatically backup all of your database containers. Docker Image Tags: docker.io/jandi/database-backup

Jan Dittrich 16 Dec 31, 2022
gunicorn 'Green Unicorn' is a WSGI HTTP Server for UNIX, fast clients and sleepy applications.

Gunicorn Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX. It's a pre-fork worker model ported from Ruby's Unicorn project. The Gunicorn

Benoit Chesneau 8.7k Jan 08, 2023
A cpp project template that uses CMake to build and Google Test / Github Actions to provide a CI

A cpp project template that uses CMake to build and Google Test / Github Actions to provide a CI

Martin Olivier 6 Nov 17, 2022
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
A cron monitoring tool written in Python & Django

Healthchecks Healthchecks is a cron job monitoring service. It listens for HTTP requests and email messages ("pings") from your cron jobs and schedule

Healthchecks 5.8k Jan 02, 2023
Quick & dirty controller to schedule Kubernetes Jobs later (once)

K8s Jobber Operator Quickly implemented Kubernetes controller to enable scheduling of Jobs at a later time. Usage: To schedule a Job later, Set .spec.

Jukka Väisänen 2 Feb 11, 2022
Helperpod - A CLI tool to run a Kubernetes utility pod with pre-installed tools that can be used for debugging/testing purposes inside a Kubernetes cluster

Helperpod is a CLI tool to run a Kubernetes utility pod with pre-installed tools that can be used for debugging/testing purposes inside a Kubernetes cluster.

Atakan Tatlı 2 Feb 05, 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
MLops tools review for execution on multiple cluster types: slurm, kubernetes, dask...

MLops tools review focused on execution using multiple cluster types: slurm, kubernetes, dask...

4 Nov 30, 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
Manage your SSH like a boss.

--- storm is a command line tool to manage your ssh connections. features adding, editing, deleting, listing, searching across your SSHConfig. command

Emre Yılmaz 3.9k Jan 03, 2023