# Add a machine-hostname-based color flag to the prompt _i || return # Find the flag binary flag_bin="%%LOCALBASE%%/bin/flag" [ -x "${flag_bin}" ] || flag_bin="$(which flag 2>/dev/null)" [ -x "${flag_bin}" ] || return # Import flag, if wanted [ -f "${HOME}/.noflag" ] || FLAG="($(${flag_bin} -e))" # Patch flag into prompt, if not already there [ "${FLAG}" ] && echo "${PS1}" | grep -q "${FLAG}" || PS1="${FLAG}${PS1}" # Clean up environment unset flag_bin