Merge pull request #1540 from davidpfarrell/plugins/brainy/sudo

theme/brainy: Update sudo check method
pull/1543/head
Nils Winkler 2020-04-01 10:02:21 +02:00 committed by GitHub
commit a1b78effb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ ____brainy_bottom() {
___brainy_prompt_user_info() { ___brainy_prompt_user_info() {
color=$bold_blue color=$bold_blue
if [ "${THEME_SHOW_SUDO}" == "true" ]; then if [ "${THEME_SHOW_SUDO}" == "true" ]; then
if [ $(sudo -n id -u 2>&1 | grep 0) ]; then if sudo -vn 1>/dev/null 2>&1; then
color=$bold_red color=$bold_red
fi fi
fi fi