Add xprofile to start SSH agent

This commit is contained in:
Jake Howard 2023-07-31 14:25:31 +01:00
parent e363ad3296
commit fbf2b4598f
Signed by: jake
GPG key ID: 57AFB45680EDD477
4 changed files with 19 additions and 13 deletions

View file

@ -1,5 +0,0 @@
GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
LANG=en_GB.UTF-8
ARCHFLAGS="-arch x86_64"
SSH_AUTH_SOCK=/tmp/ssh-agent-{{ user }}.sock
MOZ_USE_XINPUT2=1

11
files/xprofile.sh Normal file
View file

@ -0,0 +1,11 @@
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
export LANG=en_GB.UTF-8
export ARCHFLAGS="-arch x86_64"
export MOZ_USE_XINPUT2=1
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
ssh-agent > "$XDG_RUNTIME_DIR/ssh-agent.env"
fi
if [[ ! -f "$SSH_AUTH_SOCK" ]]; then
source "$XDG_RUNTIME_DIR/ssh-agent.env" >/dev/null
fi

View file

@ -51,14 +51,6 @@
validate: zsh -n %s
backup: true
- name: Install global environment variables
template:
src: ./files/global-environment
dest: /etc/environment
mode: 0644
owner: root
group: root
- name: Install tmux config
template:
src: ./files/tmux.conf

View file

@ -26,3 +26,11 @@
create: true
validate: visudo -cf %s
mode: 0640
- name: Install xprofile
template:
src: ./files/xprofile.sh
dest: "{{ home }}/.xprofile"
mode: 0644
owner: "{{ user }}"
group: "{{ user }}"