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
Visual disk-usage analyser for docker images

whaler What? A command-line tool for visually investigating the disk usage of docker images Why? Large images are slow to move and expensive to store.

Treebeard Technologies 194 Sep 01, 2022
Simple, Pythonic remote execution and deployment.

Welcome to Fabric! Fabric is a high level Python (2.7, 3.4+) library designed to execute shell commands remotely over SSH, yielding useful Python obje

Fabric 13.8k Jan 06, 2023
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
Cado Response Integration with Amazon GuardDuty using AWS Lambda

Cado Response Integration with Amazon GuardDuty using AWS Lambda This repository contains a simple example where: An alert is triggered by GuardDuty T

Cado Security 4 Mar 02, 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
DataOps framework for Machine Learning projects.

Noronha DataOps Noronha is a Python framework designed to help you orchestrate and manage ML projects life-cycle. It hosts Machine Learning models ins

52 Oct 30, 2022
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
Chef-like functionality for Fabric

/ / ___ ___ ___ ___ | | )| |___ | | )|___) |__ |__/ | __/ | | / |__ -- Chef-like functionality for Fabric About Fabric i

Sébastien Pierre 1.3k Dec 21, 2022
Azure plugins for Feast (FEAture STore)

Feast on Azure This project provides resources to enable running a feast feature store on Azure. Feast Azure Provider The Feast Azure provider acts li

Microsoft Azure 70 Dec 31, 2022
sysctl/sysfs settings on a fly for Kubernetes Cluster. No restarts are required for clusters and nodes.

SysBindings Daemon Little toolkit for control the sysctl/sysfs bindings on Kubernetes Cluster on the fly and without unnecessary restarts of cluster o

Wallarm 19 May 06, 2022
Get Response Of Container Deployment Kube with python

get-response-of-container-deployment-kube 概要 get-response-of-container-deployment-kube は、例えばエッジコンピューティング環境のコンテナデプロイメントシステムにおいて、デプロイ元の端末がデプロイ先のコンテナデプロイ

Latona, Inc. 3 Nov 05, 2021
Checkmk kube agent - Checkmk Kubernetes Cluster and Node Collectors

Checkmk Kubernetes Cluster and Node Collectors Checkmk cluster and node collecto

tribe29 GmbH 15 Dec 26, 2022
A tool to clone efficiently all the repos in an organization

cloner A tool to clone efficiently all the repos in an organization Installation MacOS (not yet tested) python3 -m venv .venv pip3 install virtualenv

Ramon 6 Apr 15, 2022
Kubediff: a tool for Kubernetes to show differences between running state and version controlled configuration.

Kubediff: a tool for Kubernetes to show differences between running state and version controlled configuration.

Weaveworks 1.1k Dec 30, 2022
A colony of interacting processes

NColony Infrastructure for running "colonies" of processes. Hacking $ tox Should DTRT -- if it passes, it means unit tests are passing, and 100% cover

23 Apr 04, 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
Run Oracle on Kubernetes with El Carro

El Carro is a new project that offers a way to run Oracle databases in Kubernetes as a portable, open source, community driven, no vendor lock-in container orchestration system. El Carro provides a p

Google Cloud Platform 205 Dec 30, 2022
Learning and experimenting with Kubernetes

Kubernetes Experiments This repository contains code that I'm using to learn and experiment with Kubernetes. 1. Environment setup minikube kubectl doc

Richard To 10 Dec 02, 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
Ingress patch example by Kustomize

Ingress patch example by Kustomize

Jinu 10 Nov 14, 2022