diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2021-11-05 22:49:06 -0400 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2021-11-05 22:49:06 -0400 |
| commit | 7976dfdf537947de6b30159229759438631e4aa5 (patch) | |
| tree | 6b645103ae64e06af5b40224c7c625acb42658b1 /kshrc | |
| parent | 5f43e928faf272abb7a173f904203bf3c42d6feb (diff) | |
| download | dotfiles-7976dfdf537947de6b30159229759438631e4aa5.tar.gz dotfiles-7976dfdf537947de6b30159229759438631e4aa5.tar.xz | |
Set ASKPASS program before starting the agent.
Move completion commands into their own function.
Diffstat (limited to 'kshrc')
| -rw-r--r-- | kshrc | 44 |
1 files changed, 35 insertions, 9 deletions
@@ -193,6 +193,35 @@ export CHARSET="$1"; export LANG="$1"; } +set_ksh_competion() { + if [ -z "$KSH_VERSION" ] ; then return ; fi + + if [ -r ~/.passsword-store ] ; then + + #shellcheck disable=SC2046 + set -A complete_pass -- show find otp grep \ + insert edit generate rm mv cp \ + $(showPasswordStore ~/.password-store) + + #shellcheck disable=SC2046 + [ -x "$(command -v dpw)" ] && set -A complete_dpw_1 -- \ + show copy type list ls mv cp rm edit otp fnd find insert \ + && set -A complete_dpw_2 -- $(dpw list) + + #shellcheck disable=SC2046 + set -A complete_passenv -- \ + $(showPasswordStore ~/.password-store) + + fi + + #shellcheck disable=SC2046 + set -A complete_ssh -- -L -D -A -X \ + $(showsshhosts | awk '{print $1}') + + set -A complete_setPrompt -- date time basic + +} + # Usage debugstarttls $ipaddr:$port debugstarttls() { openssl s_client -starttls smtp -crlf -connect "$1" "$2" @@ -335,6 +364,10 @@ timestamp() { } checkSSHAgent() { + if [ "$1" = "-k" ] ; then + pkill -9 ssh-agent + fi + ssh_agent_conf="$HOME/.ssh/agent" if [ -e "$ssh_agent_conf" ] ; then #shellcheck disable=SC1090 @@ -695,9 +728,9 @@ setaliases setsudoaliases if [ -n "$DISPLAY" ] ; then - checkSSHAgent [ -x "$(command -v dmenu_askpass)" ] && \ export SSH_ASKPASS=dmenu_askpass + checkSSHAgent fi @@ -711,14 +744,7 @@ elif [ -n "$KSH_VERSION" ] ; then bind ^L=clear-screen set -o emacs - [ -r ~/.password-store ] && set -A complete_pass -- show find otp grep \ - insert edit generate rm mv cp \ - $(showPasswordStore ~/.password-store) - [ -r ~/.password-store ] && set -A complete_passenv -- \ - $(showPasswordStore ~/.password-store) - [ -r ~/.ssh/config ] && set -A complete_ssh -- -L -D -A -X \ - $(showsshhosts | awk '{print $1}') - set -A complete_setPrompt -- date time basic + set_ksh_competion # if you want PWD # export PS1='`nzret`\u@\h \$PWD \$ ' |
