This commit is contained in:
zack 2024-11-06 13:53:16 -05:00
parent e04e38d68b
commit 6ea10852a9
No known key found for this signature in database
GPG key ID: 5F873416BCF59F35

View file

@ -21,6 +21,7 @@ writeShellScriptBin "enc" ''
# Create recipient arguments for gpg # Create recipient arguments for gpg
recipients=() recipients=()
recipients+=("-r" "0x5F873416BCF59F35")
for recipient in "$@"; do for recipient in "$@"; do
recipients+=("-r" "$recipient") recipients+=("-r" "$recipient")
done done
@ -39,14 +40,17 @@ writeShellScriptBin "enc" ''
--armor \ --armor \
--trust-model always \ --trust-model always \
"''${recipients[@]}" \ "''${recipients[@]}" \
"$temp_file" | ${wl-clipboard}/bin/wl-copy "$temp_file"
cat "$temp_file".asc | ${wl-clipboard}/bin/wl-copy --type text/plain
echo "Encrypted content copied to Wayland clipboard" echo "Encrypted content copied to Wayland clipboard"
elif [[ -n "$DISPLAY" ]]; then elif [[ -n "$DISPLAY" ]]; then
${gnupg}/bin/gpg --encrypt \ ${gnupg}/bin/gpg --encrypt \
--armor \ --armor \
--trust-model always \ --trust-model always \
"''${recipients[@]}" \ "''${recipients[@]}" \
"$temp_file" | ${xclip}/bin/xclip -selection clipboard "$temp_file"
cat "$temp_file.asc" | ${xclip}/bin/xclip -selection clipboard
echo "Encrypted content copied to X11 clipboard" echo "Encrypted content copied to X11 clipboard"
else else
echo "No display detected, cannot copy to clipboard" echo "No display detected, cannot copy to clipboard"