themes/powerline: Avoid using non-POSIX uptime

This commit is contained in:
Koichi Murase
2022-01-18 15:44:39 +09:00
parent 1d1b160a8d
commit 8c6b66ca14

View File

@@ -19,7 +19,8 @@ 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
# check whether sudo is active for no-password executions
if sudo -n cat <<< c3bcc5c 2>&1 | grep -q c3bcc5c; then
color=${USER_INFO_THEME_PROMPT_COLOR_SUDO}
fi
fi