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
A Python Implementation for Git for learning

A pure Python implementation for Git based on Buliding Git

shidenggui 42 Jul 13, 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
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
This is a tool to develop, build and test PHP extensions in Docker containers.

Develop, Build and Test PHP Extensions This is a tool to develop, build and test PHP extensions in Docker containers. Installation Clone this reposito

Suora GmbH 10 Oct 22, 2022
Play Wordle from any Kubernetes cluster.

wordle-operator 🟩 ⬛ 🟩 🟨 ⬛ Play Wordle from any Kubernetes cluster. Using the power of CustomResourceDefinitions and Kubernetes Operators, now you c

Lucas Melin 1 Jan 15, 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
📦 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
Tools and Docker images to make a fast Ruby on Rails development environment

Tools and Docker images to make a fast Ruby on Rails development environment. With the production templates, moving from development to production will be seamless.

1 Nov 13, 2022
🐳 Docker templates for various languages.

Docker Deployment Templates One Stop repository for Docker Compose and Docker Templates for Deployment. Features Python (FastAPI, Flask) Screenshots D

CodeChef-VIT 6 Aug 28, 2022
Micro Data Lake based on Docker Compose

Micro Data Lake based on Docker Compose This is the implementation of a Minimum Data Lake

Abel Coronado 15 Jan 07, 2023
Kube kombu - Running kombu consumers with support of liveness probe for kubernetes

Setup and Running Kombu consumers Steps: Install python 3.9 or greater on your s

Anmol Porwal 5 Dec 10, 2022
ZeroMQ bindings for Twisted

Twisted bindings for 0MQ Introduction txZMQ allows to integrate easily ØMQ sockets into Twisted event loop (reactor). txZMQ supports both CPython and

Andrey Smirnov 149 Dec 08, 2022
Dynamic DNS service

About nsupdate.info https://nsupdate.info is a free dynamic DNS service. nsupdate.info is also the name of the software used to implement it. If you l

nsupdate.info development 880 Jan 04, 2023
SSH tunnels to remote server.

Author: Pahaz Repo: https://github.com/pahaz/sshtunnel/ Inspired by https://github.com/jmagnusson/bgtunnel, which doesn't work on Windows. See also: h

Pavel White 1k Dec 28, 2022
Dockerized iCloud drive

iCloud-drive-docker is a simple iCloud drive client in Docker environment. It uses pyiCloud python library to interact with iCloud

Mandar Patil 376 Jan 01, 2023
Repository tracking all OpenStack repositories as submodules. Mirror of code maintained at opendev.org.

OpenStack OpenStack is a collection of interoperable components that can be deployed to provide computing, networking and storage resources. Those inf

Mirrors of opendev.org/openstack 4.6k Dec 28, 2022
A Simple script to hunt unused Kubernetes resources.

K8SPurger A Simple script to hunt unused Kubernetes resources. Release History Release 0.3 Added Ingress Added Services Account Adding RoleBindding Re

Yogesh Kunjir 202 Nov 19, 2022
A job launching library for docker, EC2, GCP, etc.

doodad A library for packaging dependencies and launching scripts (with a focus on python) on different platforms using Docker. Currently supported pl

Justin Fu 55 Aug 27, 2022
Nagios status monitor for your desktop.

Nagstamon Nagstamon is a status monitor for the desktop. It connects to multiple Nagios, Icinga, Opsview, Centreon, Op5 Monitor/Ninja, Checkmk Multisi

Henri Wahl 361 Jan 05, 2023
a CLI that provides a generic automation layer for assessing the security of ML models

Counterfit About | Getting Started | Learn More | Acknowledgments | Contributing | Trademarks | Contact Us -------------------------------------------

Microsoft Azure 575 Jan 02, 2023