Make powerline-multiline use the same check for sudo

Reduces number of subprocesses to check for passwordless sudo by 1.
pull/484/head
jitakirin 2015-05-22 08:51:32 +01:00
parent b8649312e4
commit 595ae1ab07
1 changed files with 1 additions and 2 deletions

View File

@ -55,8 +55,7 @@ function set_rgb_color {
function powerline_shell_prompt {
SHELL_PROMPT_COLOR=${SHELL_THEME_PROMPT_COLOR}
CAN_I_RUN_SUDO=$(sudo -n uptime 2>&1 | grep "load" | wc -l)
if [ ${CAN_I_RUN_SUDO} -gt 0 ]; then
if sudo -n uptime 2>&1 | grep -q "load"; then
SHELL_PROMPT_COLOR=${SHELL_THEME_PROMPT_COLOR_SUDO}
fi
SEGMENT_AT_RIGHT=0