Wip: fix the software ...

This commit is contained in:
mrjk 2020-04-24 17:36:19 +07:00
parent 16fd26547c
commit f722286fda
12 changed files with 673 additions and 319 deletions

919
bin/idmgr

File diff suppressed because it is too large Load Diff

1
bin/idmgr.sh Symbolic link
View File

@ -0,0 +1 @@
idmgr

View File

@ -1,6 +1,6 @@
#!/bin/bash
IDM_MOD_DEPS="id pass gpg ssh"
IDM_MOD_CLOUD_DEPS="s3"
## Prompt functions
##########################################

View File

@ -1,8 +1,10 @@
#!/bin/bash
IDM_MOD_DEPS="id"
IDM_MOD_GIT_DEPS="s1 id ssh"
IDM_DISABLE_AUTO+=" git__enable git__disable git__kill "
#idm_hook_register enable idm_git__enable 5
## Environments
##############################

View File

@ -1,6 +1,6 @@
#!/bin/bash
IDM_MOD_DEPS="id"
IDM_MOD_GPG_DEPS="s0 id"
idm_gpg__help ()

View File

@ -1,6 +1,6 @@
#!/bin/bash
IDM_MOD_DEPS=""
IDM_MOD_ID_DEPS="s0"
## Identity functions
##########################################

View File

@ -1,6 +1,6 @@
#!/bin/bash
IDM_MOD_DEPS="id gpg"
IDM_MOD_PASS_DEPS="s2"
## Pass functions

View File

@ -1,6 +1,6 @@
#!/bin/bash
IDM_MOD_DEPS="id pass gpg ssh"
IDM_MOD_PS1_DEPS="s4 id pass gpg ssh"
IDM_DISABLE_AUTO+="ps1__ls"
## Prompt functions
@ -13,7 +13,7 @@ idm_ps1 ()
local action=${1-}
shift || true
idm_ps1_ls
idm_ps1__ls
}
idm_ps1__ls ()

View File

@ -1,7 +1,6 @@
#!/bin/bash
IDM_MOD_DEPS="id gpg"
IDM_MOD_SSH_DEPS="s0 id gpg"
# trap 'idm_ssh_kill' 0

View File

@ -1,6 +1,6 @@
#!/bin/bash
IDM_MOD_DEPS="id gpg git"
IDM_MOD_TOMB_DEPS="s3 id gpg git"
IDM_MOD_TAGS="id tool"
IDM_MOD_PROG="safe yadm"
IDM_MOD_PREF="core id"

45
shell/bash/startup.sh Normal file
View File

@ -0,0 +1,45 @@
#!/bin/bash
export IDM_SHELL_PS1=${IDM_SHELL_PS1:-${PS1-}}
IDM_SRC_WORDS=${IDM_SRC_WORDS-}
IDM_BIN=${IDM_BIN:-idmgr}
i ()
{
if grep -q ":${1:-NONE}:" <<<"${IDM_SRC_WORDS}"; then
result="$( $IDM_BIN $@)"
# Debug module
if [ "${ID_DEBUG-}" == "true" ]; then
if [ "${result:-NONE}" == "NONE" ]; then
echo "======= ${result:-NONE}"
else
echo ======= Shell has sourced =======
echo "${result:-NONE}"
echo =======
fi
fi
# Parse output
eval "$result"
else
$IDM_BIN $@
fi
}
# Disable when pressing C-b in shell :)
bind -x '"\C-b": i disable'
# Show current identities
echo "INFO: idmgr has been loaded, use 'idmgr' or 'i' to call it"
#$IDM_BIN id ls