fix(themes/{brainy,powerbash10k}): match UID 0 exactly

This commit is contained in:
Koichi Murase 2024-07-09 01:01:35 +09:00
parent e5582de6ec
commit a5894e6f14
2 changed files with 2 additions and 2 deletions

View File

@ -85,7 +85,7 @@ function ____brainy_bottom {
function ___brainy_prompt_user_info {
local color=$_omb_prompt_bold_navy
if [[ $THEME_SHOW_SUDO == true ]]; then
if sudo -n id -u 2>&1 | grep -q 0; then
if [[ $(sudo -n id -u 2>&1) == 0 ]]; then
color=$_omb_prompt_bold_brown
fi
fi

View File

@ -127,7 +127,7 @@ function __pb10k_bottom {
function __pb10k_prompt_user_info {
local color=$_omb_prompt_bold_olive
if [[ $THEME_SHOW_SUDO == true ]]; then
if sudo -n id -u 2>&1 | grep -q 0; then
if [[ $(sudo -n id -u 2>&1) == 0 ]]; then
color=$_omb_prompt_bold_brown
fi
fi