diff --git a/config/systemd/user/default.target.wants/ssh-agent.service b/config/systemd/user/default.target.wants/ssh-agent.service new file mode 120000 index 0000000..fbfd099 --- /dev/null +++ b/config/systemd/user/default.target.wants/ssh-agent.service @@ -0,0 +1 @@ +../ssh-agent.service \ No newline at end of file diff --git a/config/systemd/user/ssh-agent.service b/config/systemd/user/ssh-agent.service new file mode 100644 index 0000000..dd23fde --- /dev/null +++ b/config/systemd/user/ssh-agent.service @@ -0,0 +1,13 @@ +[Unit] +Description=SSH publickey authentication agent + +[Service] +Type=simple +Environment=SSH_AUTH_SOCK=%t/ssh-agent.sock +ExecStart=/usr/bin/ssh-agent -D -a ${SSH_AUTH_SOCK} +ExecStartPost=/usr/bin/systemctl --user set-environment SSH_AUTH_SOCK=${SSH_AUTH_SOCK} +ExecStopPre=/usr/bin/systemctl --user unset-environment SSH_AUTH_SOCK=${SSH_AUTH_SOCK} + +[Install] +WantedBy=default.target + diff --git a/install b/install index 2c6e9bc..d6cb548 100755 --- a/install +++ b/install @@ -102,12 +102,16 @@ msg "Linking .config files... ($XDG_CONFIG_HOME)" mkdir "$XDG_CONFIG_HOME/$dir" fi done - for file in $(find . -type f); do + for file in $(find . -type f -o -type l); do file="${file:2}" color 32 echo " Adding $file" - relink "$DOT/config/$file" "$XDG_CONFIG_HOME/$file" + if [[ -L "$file" ]]; then + cp "$file" "$XDG_CONFIG_HOME/$file" + else + relink "$DOT/config/$file" "$XDG_CONFIG_HOME/$file" + fi done -); +) # Setup git msg "Setting up Git configuration..."