AutoYADM commit: 2025-03-17 23:15:07

This commit is contained in:
Daniel Fichtinger 2025-03-17 23:15:07 -04:00
parent f5b3ffcde5
commit f03d12c69c
5 changed files with 17 additions and 16 deletions

View file

@ -2,11 +2,12 @@
# if the clipboard is plain/text, we assume it's a path
# otherwise, we assume it's a mime-type to be pasted
if wl-paste --list-types | grep -qv '^text/plain$'; then
TYPE=$(wl-paste --list-types)
if "$TYPE" | grep -qv '^text/plain$'; then
# clipboard contains a file
tempdir=$(mktemp -d)
wl-paste >temp
extension=$(grep -E "^$(wl-paste --list-types)" /etc/mime.types | awk '{print $2}')
extension=$(grep -E "^$TYPE" /etc/mime.types | awk '{print $2}')
# echo -n "File name: " >&2
# read -r user_input
read -r -p "$(echo -n "Enter file name (extension .$extension will be appended): " >&2)" user_input
@ -21,6 +22,9 @@ if wl-paste --list-types | grep -qv '^text/plain$'; then
exit 1
;;
esac
elif "$TYPE" | grep -q '^text/uri-list$' && "$TYPE" | grep -q '^file://'; then
# convert URI into standard path
echo "hola"
else
# clipboard contains a string (treat as path)
read -r -p "$(echo -n "Your clipboard contains $(wl-paste), which will be attached as a file path. Confirm (y/n): " >&2)" confirm