| {%- 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 %} |