#!/usr/bin/env bash set -x QUERY=$1 SWAYSOCK=/run/user/$UID/sway-ipc.$UID.$(pidof sway).sock export SWAYSOCK if [ -z "$QUERY" ]; then QUERY='' fi input=$(gopass list -f | fzf -q "$QUERY") printf '%s' "$(gopass show -o "$input")" | wl-copy swaymsg exec -- notify-send "gopass" "Copied ${input} to clipboard." -t 2000 sleep 5 wl-copy --clear swaymsg exec -- notify-send "gopass" "Cleared clipboard" -t 1000