Remove pass prefix in launcher
This commit is contained in:
parent
1803eade04
commit
88be6bf8db
1 changed files with 11 additions and 23 deletions
|
@ -60,31 +60,19 @@ pkgs.writeScriptBin "launcher" ''
|
||||||
pass_options(){
|
pass_options(){
|
||||||
prefix=''${PASSWORD_STORE_DIR-~/.password-store}
|
prefix=''${PASSWORD_STORE_DIR-~/.password-store}
|
||||||
password_files=( "$prefix"/**/*.gpg )
|
password_files=( "$prefix"/**/*.gpg )
|
||||||
printf 'pass password %s\n' ''${''${password_files%.gpg}#$prefix/}
|
printf 'password %s\n' ''${''${password_files%.gpg}#$prefix/}
|
||||||
printf 'pass username %s\n' ''${''${password_files%.gpg}#$prefix/}
|
printf 'username %s\n' ''${''${password_files%.gpg}#$prefix/}
|
||||||
printf 'pass otp %s\n' ''${''${password_files%.gpg}#$prefix/}
|
printf 'otp %s\n' ''${''${password_files%.gpg}#$prefix/}
|
||||||
printf 'pass edit %s\n' ''${''${password_files%.gpg}#$prefix/}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pass() {
|
username() {
|
||||||
option=$(echo $1 | sed "s/^\([^ ]*\) .*$/\1/")
|
swaymsg exec -- "${pkgs.pass}/bin/pass show '$1' | sed -n 's/^Username: *//p' | tr -d '\n' | ${pkgs.wl-clipboard}/bin/wl-copy --foreground"
|
||||||
passfile=$(echo $1 | sed "s/^[^ ]* \(.*$\)/\1/")
|
}
|
||||||
echo $option
|
password() {
|
||||||
echo $passfile
|
swaymsg exec -- "${pkgs.pass}/bin/pass show -c0 '$1'"
|
||||||
case $option in
|
}
|
||||||
username)
|
otp() {
|
||||||
swaymsg exec -- "${pkgs.pass}/bin/pass show '$passfile' | sed -n 's/^Username: *//p' | tr -d '\n' | ${pkgs.wl-clipboard}/bin/wl-copy --foreground"
|
swaymsg exec -- "${pkgs.pass}/bin/pass otp -c '$1'"
|
||||||
;;
|
|
||||||
password)
|
|
||||||
swaymsg exec -- "${pkgs.pass}/bin/pass show -c0 '$passfile'"
|
|
||||||
;;
|
|
||||||
otp)
|
|
||||||
swaymsg exec -- "${pkgs.pass}/bin/pass otp -c '$passfile'"
|
|
||||||
;;
|
|
||||||
edit)
|
|
||||||
${pkgs.pass}/bin/pass edit "$passfile"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
}
|
||||||
|
|
||||||
record_options() {
|
record_options() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue