From b860ff88580f0fff2067c649c1459781299d3574 Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Sat, 6 Apr 2024 11:03:50 -0400 Subject: [PATCH] Adds raycast scripts directory and pass-copy command. --- scripts/scripts/raycast/pass-copy.sh | 32 +++++++++++++++++++ .../raycast/script-command.template.sh | 17 ++++++++++ 2 files changed, 49 insertions(+) create mode 100755 scripts/scripts/raycast/pass-copy.sh create mode 100755 scripts/scripts/raycast/script-command.template.sh diff --git a/scripts/scripts/raycast/pass-copy.sh b/scripts/scripts/raycast/pass-copy.sh new file mode 100755 index 0000000..774c64d --- /dev/null +++ b/scripts/scripts/raycast/pass-copy.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title pass-copy +# @raycast.mode compact + +# Optional parameters: +# @raycast.icon 🤖 +# @raycast.argument1 { "type": "text", "placeholder": "name" } +# @raycast.packageName Password + +# Documentation: +# @raycast.description Copy password from password-store +# @raycast.author Michael Housh +# @raycast.authorURL https://github.com/m-housh + +#echo "Hello World! Argument1 value: "$1"" + +PREFIX="$HOME/.local/share/password-store" +selected=$(find "$PREFIX" -type f -name "$1".gpg) +echo "Selected find: $selected" > /tmp/pass-copy.out + +if [[ -n "$selected" ]]; then + selected="${selected//$PREFIX/}" + selected="${selected//.gpg/}" + echo "Selected cleaned: $selected" >> /tmp/pass-copy.out + pass -c "$selected" +else + exit 1 +fi + diff --git a/scripts/scripts/raycast/script-command.template.sh b/scripts/scripts/raycast/script-command.template.sh new file mode 100755 index 0000000..b642b7e --- /dev/null +++ b/scripts/scripts/raycast/script-command.template.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Raycast Script Command Template +# +# Duplicate this file and remove ".template." from the filename to get started. +# See full documentation here: https://github.com/raycast/script-commands +# +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title My First Script +# @raycast.mode fullOutput +# +# Optional parameters: +# @raycast.icon 🤖 +# @raycast.packageName Raycast Scripts + +echo "Hello from My First Script" \ No newline at end of file