Update commands
This commit is contained in:
parent
70f3600de3
commit
b63101ef5e
@ -1,10 +1,10 @@
|
|||||||
### PROCESS
|
### PROCESS
|
||||||
# mnemonic: [K]ill [P]rocess
|
# mnemonic: [K]ill [P]rocess
|
||||||
# show output of "ps -ef", use [tab] to select one or multiple entries
|
# show output of "ps -ef", use [tab] to select one or multiple entries
|
||||||
# press [enter] to kill selected processes.
|
# press [enter] to kill selected processes
|
||||||
# press [escape] to exit.
|
# 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" ]
|
if [ "x$pid" != "x" ]
|
||||||
then
|
then
|
||||||
|
39
home/.zsh/cmd/pf.sh
Executable file
39
home/.zsh/cmd/pf.sh
Executable 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
|
@ -1,6 +1,6 @@
|
|||||||
### ASDF
|
### ASDF
|
||||||
# uninstall multiple languages at once, async
|
|
||||||
# mnemonic [V]ersion [M]anager [C]lean
|
# mnemonic [V]ersion [M]anager [C]lean
|
||||||
|
# uninstall multiple languages at once, async
|
||||||
|
|
||||||
lang=${1}
|
lang=${1}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user