2024-03-26 14:22:08 +01:00
|
|
|
# /etc/bashrc
|
2024-03-26 15:58:56 +01:00
|
|
|
{{ ansible_managed | comment }}
|
2024-03-26 14:22:08 +01:00
|
|
|
|
|
|
|
# System wide functions and aliases
|
|
|
|
# Environment stuff goes in /etc/profile
|
|
|
|
|
|
|
|
# enable color support of ls and also add handy aliases
|
|
|
|
if [ -x /usr/bin/dircolors ]; then
|
|
|
|
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
|
|
|
{% for alias in dotfiles__aliases %}
|
2024-04-06 19:42:57 +02:00
|
|
|
{% if alias.color %}
|
2024-03-26 14:22:08 +01:00
|
|
|
alias {{ alias.alias }}="{{ alias.command }} --color=auto"
|
2024-04-06 19:42:57 +02:00
|
|
|
{% endif %}
|
2024-03-26 14:22:08 +01:00
|
|
|
{% endfor %}
|
|
|
|
fi
|
|
|
|
|
2024-03-26 15:58:56 +01:00
|
|
|
{% for alias in l3d_users__dotfiles__aliases %}
|
2024-04-06 19:42:57 +02:00
|
|
|
{% if not alias.color %}
|
2024-03-26 14:22:08 +01:00
|
|
|
alias {{ alias.alias }}="{{ alias.command }}"
|
2024-04-06 19:42:57 +02:00
|
|
|
{% endif %}
|
2024-03-26 14:22:08 +01:00
|
|
|
{% endfor %}
|
|
|
|
|
2024-04-06 19:42:57 +02:00
|
|
|
{% if l3d_users__dotfiles__bash_completion_enabled %}
|
2024-03-26 14:22:08 +01:00
|
|
|
if ! shopt -oq posix; then
|
|
|
|
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
|
|
|
. /usr/share/bash-completion/bash_completion
|
|
|
|
elif [ -f /etc/bash_completion ]; then
|
|
|
|
. /etc/bash_completion
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
# fancy Prompt
|
|
|
|
if [ $(id -u) -eq 0 ]; then
|
2024-03-26 15:58:56 +01:00
|
|
|
export PS1='{{ l3d_users__dotfiles__root_prompt }} '
|
2024-03-26 14:22:08 +01:00
|
|
|
else
|
2024-03-26 15:58:56 +01:00
|
|
|
export PS1='{{ l3d_users__dotfiles__user_prompt }} '
|
2024-03-26 14:22:08 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
2024-03-26 15:58:56 +01:00
|
|
|
HISTCONTROL={{ l3d_users__dotfiles__history_control }}
|
2024-03-26 14:22:08 +01:00
|
|
|
shopt -s histappend
|
|
|
|
{% if ansible_os_family == 'Redhat' %}
|
|
|
|
# HISTSIZE={{ dotfiles__history_size }}
|
|
|
|
# HISTFILESIZE={{ dotfiles__history_file_size }}
|
|
|
|
{% elif ansible_distribution == "CentOS" %}
|
|
|
|
# HISTSIZE={{ dotfiles__history_size }}
|
|
|
|
# HISTFILESIZE={{ dotfiles__history_file_size }}
|
|
|
|
{% else %}
|
|
|
|
HISTSIZE={{ dotfiles__history_size }}
|
|
|
|
HISTFILESIZE={{ dotfiles__history_file_size }}
|
|
|
|
{% endif %}
|
|
|
|
# vim:ts=4:sw=4
|