From 5c3dcaddd7caa2bf75e5d649211f940c6733c491 Mon Sep 17 00:00:00 2001 From: rootiest Date: Sun, 7 Jul 2024 16:00:08 -0400 Subject: [PATCH] Check for root user Check for root user and disable some plugins that don't play nice --- init.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index e07fa90..eed1dd5 100644 --- a/init.lua +++ b/init.lua @@ -402,9 +402,10 @@ require("lazy").setup({ }, { "3rd/image.nvim", - cond = function() -- Not Using SSH + cond = function() -- Not Using SSH or root local ssh = os.getenv("SSH_TTY") - return not ssh + local user = os.getenv("USER") + return not ssh and user ~= "root" end, }, { @@ -422,9 +423,10 @@ require("lazy").setup({ vim.cmd.colorscheme(kitty_theme or "catppuccin-latte") end, }, - cond = function() -- Not Using SSH + cond = function() -- Not Using SSH or root local ssh = os.getenv("SSH_TTY") - return not ssh + local user = os.getenv("USER") + return not ssh and user ~= "root" end, }, { @@ -752,8 +754,10 @@ else if vim.env.TERM:find("kitty") then -- ------------------------ Kitty -------------------------- if not vim.env.SSH_TTY then - -- Image Preview - require("image").setup() + if vim.env.USER ~= "root" then + -- Image Preview + require("image").setup() + end -- Transparency vim.cmd(":TransparentEnable") else