---
+- name: Create XDG dirs
+ file:
+ path: "{{ item }}"
+ state: directory
+ loop:
+ - "$XDG_CONFIG_HOME"
+ - "$XDG_STATE_HOME"
+ - "$XDG_STATE_HOME/bash"
+ - "$XDG_DATA_HOME"
+ - "$XDG_CACHE_HOME"
+ - "$HOME/Desktop"
+ - "$HOME/Downloads"
- name: Get gnupg runtime folder name
shell: 'GNUPGHOME=$XDG_CONFIG_HOME/gnupg gpgconf --list-dirs socketdir | sed -e "s@$XDG_RUNTIME_DIR/gnupg/@@"'
changed_when: false
- name: Remove old lines in bashrc_temp
lineinfile:
line: "{{ ('unset ' ~ item | regex_replace('=.*')) if item != '' and item.0 != '#' else '' }}"
- dest: $HOME/.bashrc_temp
+ dest: $XDG_STATE_HOME/bash/bashrc_temp
insertafter: EOF
create: true
state: present
- name: Add new lines in bashrc_temp
lineinfile:
line: "{{ ('export ' ~ item) if item != '' and item.0 != '#' else '' }}"
- dest: $HOME/.bashrc_temp
+ dest: $XDG_STATE_HOME/bash/bashrc_temp
insertafter: EOF
create: true
state: present
when: pam_environment.changed
debug:
msg: "\u26A0\uFE0F \u26A0\uFE0F You need to log out and back in to update your environment \u26A0\uFE0F \u26A0\uFE0F"
-- name: Create XDG dirs
- file:
- path: "{{ item }}"
- state: directory
- loop:
- - "$XDG_CONFIG_HOME"
- - "$XDG_STATE_HOME"
- - "$XDG_DATA_HOME"
- - "$XDG_CACHE_HOME"
- - "$HOME/Desktop"
- - "$HOME/Downloads"
{% if "graphical_vt" in features.get(profile, []) %}
if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
- [[ -f "$HOME/.bashrc_temp" ]] && rm -f $HOME/.bashrc_temp
+ [[ -f "$XDG_STATE_HOME/bash/bashrc_temp" ]] && rm -f $XDG_STATE_HOME/bash/bashrc_temp
exec startx $XDG_CONFIG_HOME/xinitrc > $XDG_STATE_HOME/xsession_errors 2>&1
fi
{% endif %}
# ~/.bashrc
#
-[[ -f "$HOME/.bashrc_temp" ]] && . $HOME/.bashrc_temp
+[[ -f "$XDG_STATE_HOME/bash/bashrc_temp" ]] && . $XDG_STATE_HOME/bash/bashrc_temp
if [ -n "$HOME/.local/bin" ]; then
PATH="$HOME/.local/bin:$PATH"
PS1='\[\033[01;31m\]$(error_code)\[\033[00;00m\]$(running_jobs)\[$(git_prompt_color)\]$(git_prompt)\[\033[00;32m\]\u@\h\[\033[94m\] \w \$\[\033[00m\] '
{% endif %}
+PROMPT_COMMAND="[[ -f "$XDG_STATE_HOME/bash/bashrc_temp" ]] && . $XDG_STATE_HOME/bash/bashrc_temp"
+
{% if "nodejs" in features.get(profile, []) %}
source /usr/share/nvm/init-nvm.sh
{% endif %}