aboutsummaryrefslogtreecommitdiff
path: root/kshrc
diff options
context:
space:
mode:
Diffstat (limited to 'kshrc')
-rw-r--r--kshrc44
1 files changed, 35 insertions, 9 deletions
diff --git a/kshrc b/kshrc
index 67cf74a..d37807e 100644
--- a/kshrc
+++ b/kshrc
@@ -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 \$ '