From 4c515f9f76a7404f819880a9d0e79bdc7b24a9d6 Mon Sep 17 00:00:00 2001 From: Akemi Izuko Date: Sat, 23 Dec 2023 20:14:20 -0700 Subject: [PATCH] Fix text-console detection vim --- vim/.vim/init_scripts/settings.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/.vim/init_scripts/settings.vim b/vim/.vim/init_scripts/settings.vim index dd6ec1f..8a77680 100644 --- a/vim/.vim/init_scripts/settings.vim +++ b/vim/.vim/init_scripts/settings.vim @@ -139,7 +139,7 @@ command! Light3 :colo base16-atelier-estuary-light | FH command! Light4 :colo base16-atelier-plateau-light | FH " Switch theme to match terminal ==== -if !has('termguicolors') || !has('gui_running') +if !has('termguicolors') || system("ps -e | awk '$4 ~ /Xorg|alacritty|sway/ {has_gui = 1} END {print has_gui + 0}'") == "0" colo default elseif executable('colo.sh') exec 'colo ' . system('colo.sh --colorscheme')