From aba3dc1ed7e05b7c6da3c0d3d6fe53fde81eebf1 Mon Sep 17 00:00:00 2001 From: caem Date: Sun, 4 Aug 2024 19:55:46 +0200 Subject: [PATCH] neovim: fix error when loading outside of distrobox container --- dotfiles/nvim/lua/util/get_distro.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dotfiles/nvim/lua/util/get_distro.lua b/dotfiles/nvim/lua/util/get_distro.lua index 5136dac..7bc39a8 100644 --- a/dotfiles/nvim/lua/util/get_distro.lua +++ b/dotfiles/nvim/lua/util/get_distro.lua @@ -20,11 +20,14 @@ local function distro_traits(name) icon = "", color = "#73ba25", }, - [ "distrobox" ] = { + } + + if os.getenv("CONTAINER_ID") ~= nil then + icons["distrobox"] = { icon = "[󰏗 " .. os.getenv("CONTAINER_ID") .. "]", color = "#917d62", - }, - } + } + end local icon = icons[name] if icon == nil then