Update commands

This commit is contained in:
Anton Zadvorny 2019-08-26 21:21:50 +03:00
parent 70f3600de3
commit b63101ef5e
3 changed files with 43 additions and 4 deletions

View File

@ -1,10 +1,10 @@
### PROCESS
# mnemonic: [K]ill [P]rocess
# show output of "ps -ef", use [tab] to select one or multiple entries
# press [enter] to kill selected processes.
# press [escape] to exit.
# press [enter] to kill selected processes
# press [escape] to exit
pid=$(ps -ef | sed 1d | eval "fzf ${FZF_DEFAULT_OPTS} -m --header='[kill:process]'" | awk '{print $2}')
pid=$(ps -ef | sed 1d | eval "fzf ${FZF_DEFAULT_OPTS} -m --header='[process:kill]'" | awk '{print $2}')
if [ "x$pid" != "x" ]
then

39
home/.zsh/cmd/pf.sh Executable file
View File

@ -0,0 +1,39 @@
### PASS
# mnemonic: [P]ass[F]ind
# search password in the passwotd store
# press [enter] to copy selected password
# press [escape] to exit
function entry_from_path() {
local v=$1
v=${v#$PASSWORD_STORE_DIR/}
v=${v%.gpg}
echo "$v"
}
function candidate_selector() {
query=$1
candidates=$2
echo "$candidates" | fzf ${FZF_DEFAULT_OPTS} -q "$query" --header='[pass:find]' --select-1
}
function list_entries() {
if [ -z "${PASSWORD_STORE_DIR}" ]; then
PASSWORD_STORE_DIR="${HOME}/.password-store"
fi
find "$PASSWORD_STORE_DIR" -name '*.gpg' | while read -r c; do
echo $(entry_from_path "$c");
done
}
query="$@"
candidates=$(list_entries)
res=$(candidate_selector "$query" "$candidates")
if [ -n "$res" ]; then
pass show "$res" | tail -n +2 || exit $?
pass show -c "$res"
else
exit 1
fi

View File

@ -1,6 +1,6 @@
### ASDF
# uninstall multiple languages at once, async
# mnemonic [V]ersion [M]anager [C]lean
# uninstall multiple languages at once, async
lang=${1}