blob: 0f74fef6071435a11dc3842e33602e83c6867251 [file] [log] [blame]
{%- from "linux/map.jinja" import system with context -%}
# Don't set special prompt when not using Bash or ZSH
[ -n "$BASH_VERSION" -o -n "$ZSH_VERSION" ] || return 0
# Don't set prompt on non-interactive shell
[[ $- == *i* ]] || return 0
{%- for user, prompt in system.prompt.items() %}
{%- if user != "default" %}
if $(id -u {{ user }} >/dev/null 2>&1); then
if [ $(id -u) -eq $(id -u {{ user }}) ]; then
export PS1="{{ prompt }} "
return 0
fi
fi
{%- endif %}
{%- endfor %}
{%- if system.prompt.default is defined %}
export PS1="{{ system.prompt.default }} "
{%- endif %}