diff --git a/scripts/scripts/raycast/pass-attribute.sh b/scripts/scripts/raycast/pass-attribute.sh new file mode 100755 index 0000000..581599c --- /dev/null +++ b/scripts/scripts/raycast/pass-attribute.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title pass-attribute +# @raycast.mode compact + +# Optional parameters: +# @raycast.icon 🗝️ +# @raycast.argument1 { "type": "text", "placeholder": "Key" } +# @raycast.argument2 { "type": "text", "placeholder": "For" } +# @raycast.packageName Password + +# Documentation: +# @raycast.description Get an attribute / key from the password store +# @raycast.author Michael Housh +# @raycast.authorURL https://github.com/m-housh + +PREFIX="$HOME/.local/share/password-store" +PASS=/opt/homebrew/bin/pass +key="$1" +selected=$(find "$PREFIX" -type f -name "$2.gpg") +selected="${selected//$PREFIX/}" +selected="${selected//.gpg/}" +"$PASS" get --clip "$key" "$selected" + diff --git a/scripts/scripts/raycast/pass-copy.sh b/scripts/scripts/raycast/pass-copy.sh index 774c64d..5d068a0 100755 --- a/scripts/scripts/raycast/pass-copy.sh +++ b/scripts/scripts/raycast/pass-copy.sh @@ -6,8 +6,8 @@ # @raycast.mode compact # Optional parameters: -# @raycast.icon 🤖 -# @raycast.argument1 { "type": "text", "placeholder": "name" } +# @raycast.icon 🔐 +# @raycast.argument1 { "type": "text", "placeholder": "for" } # @raycast.packageName Password # Documentation: @@ -15,17 +15,13 @@ # @raycast.author Michael Housh # @raycast.authorURL https://github.com/m-housh -#echo "Hello World! Argument1 value: "$1"" - PREFIX="$HOME/.local/share/password-store" +PASS=/opt/homebrew/bin/pass selected=$(find "$PREFIX" -type f -name "$1".gpg) -echo "Selected find: $selected" > /tmp/pass-copy.out - -if [[ -n "$selected" ]]; then +if [ -n "$selected" ]; then selected="${selected//$PREFIX/}" selected="${selected//.gpg/}" - echo "Selected cleaned: $selected" >> /tmp/pass-copy.out - pass -c "$selected" + "$PASS" --clip "$selected" else exit 1 fi