aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kshrc29
1 files changed, 24 insertions, 5 deletions
diff --git a/kshrc b/kshrc
index 78663da..321dcab 100644
--- a/kshrc
+++ b/kshrc
@@ -27,9 +27,6 @@ setaliases() {
alias search='grep -niRIE'
alias rot13="tr 'A-Za-z' 'N-ZA-Mn-za-m'"
alias setxkbmap-list="man xkeyboard-config"
- showsshhosts() {
- cat ~/.ssh/config ~/.ssh/inc/* 2>/dev/null | awk '/^[hH]ost /{$1=""; print $0}'
- }
# docker-getip $container_id
alias docker-getip="docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'"
alias xa='xargs -I{}'
@@ -230,6 +227,24 @@ setperms() {
find "$@" -type d -print0 | xargs -0 chmod "$dir_perms"
}
+showsshhosts() {
+ cat ~/.ssh/config ~/.ssh/inc/* 2>/dev/null | awk '/^[hH]ost /{$1=""; print $0}'
+}
+
+showPasswordStore() {
+_passDir="$1" ; shift
+
+find "$_passDir" -type f -iname '*.gpg' \
+| while read -r _line; do
+ _line="${_line##$_passDir}"
+ _line="${_line#/}"
+ _line="${_line%.gpg}"
+ echo "$_line"
+done
+
+unset _passDir
+}
+
set_title() {
printf $'\033]0;'"%s"$'\007' "$1"
}
@@ -641,13 +656,17 @@ setsudoaliases
if [ -n "$YASH_VERSION" ] ; then
echo "Intentionally left blank" >/dev/null 2>&1
elif [ -n "$KSH_VERSION" ] ; then
- export HISTFILE="$HOME/.ksh_history"
- export HISTSIZE=10000
+ HISTFILE="$HOME/.ksh_history"
+ HISTSIZE=10000
bind ^L=clear-screen
set -o emacs
#shellcheck disable=SC2155
+ set -A complete_pass -- show find otp grep insert edit generate rm mv cp \
+ $(showPasswordStore ~/.password-store)
+ set -A complete_ssh -- -L -D -A -X $(showsshhosts | awk '{print $1}')
+
# if you want PWD
# export PS1='\u@\h \$PWD \$ '
export PS1='\u@\h\$ '