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
Build and Push docker image in Python (luigi + docker-py)

Docker build images workflow in Python Since docker hub stopped building images for free accounts, I've been looking for another way to do it. I could

Fabien D. 2 Dec 15, 2022
Python IMDB Docker - A docker tutorial to containerize a python script.

Python_IMDB_Docker A docker tutorial to containerize a python script. Build the docker in the current directory: docker build -t python-imdb . Run the

Sarthak Babbar 1 Dec 30, 2021
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 5, 2023
Remote Desktop Protocol in Twisted Python

RDPY Remote Desktop Protocol in twisted python. RDPY is a pure Python implementation of the Microsoft RDP (Remote Desktop Protocol) protocol (client a

Sylvain Peyrefitte 1.6k Dec 30, 2022
Bitnami Docker Image for Python using snapshots for the system packages repositories

Python Snapshot packaged by Bitnami What is Python Snapshot? Python is a programming language that lets you work quickly and integrate systems more ef

Bitnami 1 Jan 13, 2022
Create pinned requirements.txt inside a Docker image using pip-tools

Pin your Python dependencies! pin-requirements.py is a script that lets you pin your Python dependencies inside a Docker container. Pinning your depen

null 4 Aug 18, 2022
DAMPP (gui) is a Python based program to run simple webservers using MySQL, Php, Apache and PhpMyAdmin inside of Docker containers.

DAMPP (gui) is a Python based program to run simple webservers using MySQL, Php, Apache and PhpMyAdmin inside of Docker containers.

Sehan Weerasekara 1 Feb 19, 2022
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 1, 2022
Define and run multi-container applications with Docker

Docker Compose Docker Compose is a tool for running multi-container applications on Docker defined using the Compose file format. A Compose file is us

Docker 28.2k Jan 8, 2023
A Python library for the Docker Engine API

Docker SDK for Python A Python library for the Docker Engine API. It lets you do anything the docker command does, but from within Python apps – run c

Docker 6.1k Dec 31, 2022
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

null 145 Nov 22, 2022
Hackergame nc 类题目的 Docker 容器资源限制、动态 flag、网页终端

Hackergame nc 类题目的 Docker 容器资源限制、动态 flag、网页终端 快速入门 配置证书 证书用于验证用户 Token。请确保这里的证书文件(cert.pem)与 Hackergame 平台 配置的证书相同,这样 Hackergame 平台为每个用户生成的 Token 才可以通

USTC Hackergame 68 Nov 9, 2022
docker-compose工程部署时的辅助脚本

okta-cmd Introduction docker-compose 辅助脚本

完美风暴666 4 Dec 9, 2021
Linux, Jenkins, AWS, SRE, Prometheus, Docker, Python, Ansible, Git, Kubernetes, Terraform, OpenStack, SQL, NoSQL, Azure, GCP, DNS, Elastic, Network, Virtualization. DevOps Interview Questions

Linux, Jenkins, AWS, SRE, Prometheus, Docker, Python, Ansible, Git, Kubernetes, Terraform, OpenStack, SQL, NoSQL, Azure, GCP, DNS, Elastic, Network, Virtualization. DevOps Interview Questions

Arie Bregman 35.1k Jan 2, 2023
🐳 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
Push Container Image To Docker Registry In Python

push-container-image-to-docker-registry 概要 push-container-image-to-docker-registry は、エッジコンピューティング環境において、特定のエッジ端末上の Private Docker Registry に特定のコンテナイメー

Latona, Inc. 3 Nov 4, 2021
Build Netbox as a Docker container

netbox-docker The Github repository houses the components needed to build Netbox as a Docker container. Images are built using this code and are relea

Farshad Nick 1 Dec 18, 2021
Some automation scripts to setup a deployable development database server (with docker).

Postgres-Docker Database Initializer This is a simple automation script that will create a Docker Postgres database with a custom username, password,

Pysogge 1 Nov 11, 2021
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