2018-11-15 10:26:52 +01:00
|
|
|
# /etc/bashrc
|
|
|
|
|
|
|
|
# System wide functions and aliases
|
|
|
|
# Environment stuff goes in /etc/profile
|
|
|
|
|
2019-01-13 20:06:29 +01:00
|
|
|
# This file may be overwritten by ansible. Please think about commiting
|
|
|
|
# changes you want to keep persistent.
|
|
|
|
|
2020-11-13 11:30:51 +01:00
|
|
|
# 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)"
|
2020-11-13 14:28:57 +01:00
|
|
|
{% for alias in dotfiles__aliases %}
|
2020-11-13 11:30:51 +01:00
|
|
|
{% if alias.color %}
|
|
|
|
alias {{ alias.alias }}="{{ alias.command }} --color=auto"
|
|
|
|
{% endif%}
|
|
|
|
{% endfor %}
|
|
|
|
fi
|
2018-11-15 10:26:52 +01:00
|
|
|
|
2020-11-13 14:28:57 +01:00
|
|
|
{% for alias in dotfiles__aliases %}
|
2020-11-13 11:30:51 +01:00
|
|
|
{% if not alias.color %}
|
|
|
|
alias {{ alias.alias }}="{{ alias.command }}"
|
|
|
|
{% endif%}
|
|
|
|
{% endfor %}
|
|
|
|
|
2020-11-13 14:28:57 +01:00
|
|
|
{%if dotfiles__bash_completion_enabled %}
|
2020-11-13 11:30:51 +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
|
2018-11-15 10:26:52 +01:00
|
|
|
fi
|
|
|
|
fi
|
2018-11-18 23:46:40 +01:00
|
|
|
|
2020-11-13 11:30:51 +01:00
|
|
|
{% endif %}
|
2018-11-18 23:46:40 +01:00
|
|
|
|
2020-11-13 11:30:51 +01:00
|
|
|
# fancy Prompt
|
|
|
|
if [ $(id -u) -eq 0 ]; then
|
2020-11-13 14:28:57 +01:00
|
|
|
export PS1='{{ dotfiles__root_prompt }} '
|
2020-11-13 11:30:51 +01:00
|
|
|
else
|
2020-11-13 14:28:57 +01:00
|
|
|
export PS1='{{ dotfiles__user_prompt }} '
|
2020-11-13 11:30:51 +01:00
|
|
|
fi
|
2019-09-26 15:17:01 +02:00
|
|
|
|
2019-07-29 08:00:33 +02:00
|
|
|
|
2020-11-13 14:28:57 +01:00
|
|
|
HISTCONTROL={{ dotfiles__history_control }}
|
2020-11-13 11:30:51 +01:00
|
|
|
shopt -s histappend
|
2021-01-07 19:28:02 +01:00
|
|
|
{% 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 %}
|
2020-11-13 14:28:57 +01:00
|
|
|
HISTSIZE={{ dotfiles__history_size }}
|
|
|
|
HISTFILESIZE={{ dotfiles__history_file_size }}
|
2021-01-07 19:28:02 +01:00
|
|
|
{% endif %}
|
|
|
|
|
2019-01-10 13:32:49 +01:00
|
|
|
|
2020-11-13 14:28:57 +01:00
|
|
|
{% for _row in dotfiles__additional_bashrc_lines | default() %}
|
2020-11-13 11:30:51 +01:00
|
|
|
{{ _row }}
|
|
|
|
{% endfor %}
|
2018-11-15 10:26:52 +01:00
|
|
|
# vim:ts=4:sw=4
|