Skip to content

Instantly share code, notes, and snippets.

@x-drum
Last active May 17, 2022 16:43
Show Gist options
  • Save x-drum/9bbf886a468dd6a06482878952ad4407 to your computer and use it in GitHub Desktop.
Save x-drum/9bbf886a468dd6a06482878952ad4407 to your computer and use it in GitHub Desktop.
ssh-agent: Archlinux plasma 5
#!/bin/sh
## place in ~/.config/plasma-workspace/shutdown/ssh-agent-shutdown.sh
## exec order: "kde shutdown"
$SSH_AGENT_PID" ] || eval "$(ssh-agent -k)"
#/bin/bash
## place in ~/.config/plasma-workspace/env/ssh-agent-sshadd.sh
ssh-add </dev/null
## uncomment if you intend to add multiple ssh keys
# ssh-add $HOME/.ssh/key1 $HOME/.ssh/key2 $HOME/.ssh/key3 </dev/null
#/bin/bash
## place in ~/.config/plasma-workspace/env/ssh-agent-startup.sh
## exec order: "kde pre-startup"
export SSH_ASKPASS="/usr/bin/ksshaskpass"
if ! pgrep -u $USER ssh-agent > /dev/null; then
ssh-agent > ~/.ssh-agent-thing
fi
if [[ "$SSH_AGENT_PID" == "" ]]; then
eval $(<~/.ssh-agent-thing)
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment