From 303e0a937e33634cb46d965134cf74b7c6cd530f Mon Sep 17 00:00:00 2001 From: buhl <221842+buhl@users.noreply.github.com> Date: Mon, 30 Mar 2020 21:46:46 +0200 Subject: [PATCH] Simplified-sudo-check --- themes/powerline/powerline.base.bash | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/themes/powerline/powerline.base.bash b/themes/powerline/powerline.base.bash index 969b210d..8c983a7b 100644 --- a/themes/powerline/powerline.base.bash +++ b/themes/powerline/powerline.base.bash @@ -18,9 +18,7 @@ function __powerline_user_info_prompt { local color=${USER_INFO_THEME_PROMPT_COLOR} if [[ "${THEME_CHECK_SUDO}" = true ]]; then - if sudo -n uptime 2>&1 | grep -q "load"; then - color=${USER_INFO_THEME_PROMPT_COLOR_SUDO} - fi + sudo -vn 1>/dev/null 2>&1 && color=${USER_INFO_THEME_PROMPT_COLOR_SUDO} fi case "${POWERLINE_PROMPT_USER_INFO_MODE}" in