dmenu ssh update to include stuff from ssh config
This commit is contained in:
parent
d0b9f13d8a
commit
ae43b3a597
1 changed files with 5 additions and 1 deletions
|
@ -3,7 +3,11 @@
|
||||||
export SSH_AUTH_SOCK="${HOME}/.ssh/ssh_auth_sock"
|
export SSH_AUTH_SOCK="${HOME}/.ssh/ssh_auth_sock"
|
||||||
cmd=$1
|
cmd=$1
|
||||||
shift
|
shift
|
||||||
result=$(sed "s/[, ].*//" ~/.ssh/known_hosts | sort -u | dmenu -p ssh ${1+"$@"}) || exit 1
|
get_hosts() {
|
||||||
|
awk -F",| " '{print $1}' "${HOME}/.ssh/known_hosts"
|
||||||
|
awk '{if ($1 == "Host") print $2}' "${HOME}/.ssh/config"
|
||||||
|
}
|
||||||
|
result=$(get_hosts | sort -u | dmenu -p ssh ${1+"$@"}) || exit 1
|
||||||
exec $cmd $result
|
exec $cmd $result
|
||||||
|
|
||||||
# call from ~/.i3/config:
|
# call from ~/.i3/config:
|
||||||
|
|
Loading…
Reference in a new issue