2023-11-13 10:59:32 +01:00
|
|
|
# pass aliases / completion
|
2023-11-27 15:23:20 +01:00
|
|
|
|
2023-11-13 10:59:32 +01:00
|
|
|
def _pass_completion [] {
|
|
|
|
_ls ~/.password-store/**/* | each { |x|
|
|
|
|
if $x.type == "file" {
|
|
|
|
$x.name
|
|
|
|
| path parse
|
|
|
|
| update extension ""
|
|
|
|
| get parent stem
|
|
|
|
| str join "/"
|
|
|
|
} else {
|
|
|
|
$x.name + "/"
|
|
|
|
}
|
|
|
|
| split row '/'
|
|
|
|
| skip 4
|
|
|
|
| str join "/"
|
|
|
|
}
|
|
|
|
| prepend git
|
|
|
|
| prepend insert
|
|
|
|
}
|
|
|
|
|
|
|
|
export extern "pass" [ host?: string@_pass_completion ]
|
2023-11-14 10:38:28 +01:00
|
|
|
|
2023-11-27 15:23:20 +01:00
|
|
|
# pass shortcut
|
|
|
|
def p [ ...arg: string@_pass_completion ] {
|
|
|
|
for a in $arg {
|
|
|
|
pass $a
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# pass with copy
|
2023-11-13 10:59:32 +01:00
|
|
|
def pc [ arg: string@_pass_completion ] { pass --clip $arg }
|
2023-11-27 15:23:20 +01:00
|
|
|
|
|
|
|
# open pdf encrypted file
|
2023-11-14 10:38:28 +01:00
|
|
|
def ppdf [p: string] {
|
|
|
|
pc thomas/key/pdf
|
|
|
|
pueue add evince $p
|
|
|
|
}
|