utils

small programs, scripts and utils
git clone https://git.e1e0.net/utils.git
Log | Files | Refs

get_pass.sh (566B)


      1 #!/usr/bin/env bash
      2 
      3 set -eu
      4 
      5 folders_json=$(bw list folders)
      6 items_json=$(bw list items)
      7 
      8 item_id=$(for i in $(echo $items_json |jq -r ".[].id"); do
      9             IFS=$'\x01' read item_name folder_id < <(echo $(echo $items_json | jq -r ".[] | select(.id==\"$i\") | [.name,.folderId] | @tsv" | tr '\t' $'\x01'))
     10             folder_name=$(echo $folders_json | jq -r ".[] | select(.id==\"$folder_id\").name")
     11 
     12             printf "$folder_name/$item_name\t$i\n"
     13           done | fzf -d "\t" --with-nth=1 | cut -f 2)
     14 
     15 bw get password $item_id | xclip -selection clipboard