AutoYADM commit: 2025-03-17 13:00:06
This commit is contained in:
parent
68191b42ef
commit
e59a96b6e5
2 changed files with 30 additions and 10 deletions
|
@ -6,13 +6,33 @@
|
||||||
# if the clipboard is plain/text, we assume it's a path
|
# if the clipboard is plain/text, we assume it's a path
|
||||||
# otherwise, we assume it's a mime-type to be pasted
|
# otherwise, we assume it's a mime-type to be pasted
|
||||||
if wl-paste --list-types | grep -qv '^text/plain$'; then
|
if wl-paste --list-types | grep -qv '^text/plain$'; then
|
||||||
notify-send "Non-text type."
|
notify-send "Non-text type."
|
||||||
temp=$(mktemp)
|
tempdir=$(mktemp -d)
|
||||||
wl-paste > temp
|
wl-paste >temp
|
||||||
grep -E "^$(wl-paste --list-types)" /etc/mime.types | awk '{print $2}'
|
extension=$(grep -E "^$(wl-paste --list-types)" /etc/mime.types | awk '{print $2}')
|
||||||
|
# echo -n "File name: " >&2
|
||||||
# echo "$temp"
|
# read -r user_input
|
||||||
|
read -r -p "$(echo -n "Enter file name (extension .$extension will be appended): " >&2)" user_input
|
||||||
|
attachment="$tempdir/$user_input.$extension"
|
||||||
|
read -r -p "$(echo -n "Your file will be written to $attachment and attached. Confirm (y/n): " >&2)" confirm
|
||||||
|
case "$confirm" in
|
||||||
|
y)
|
||||||
|
wl-paste >"$attachment"
|
||||||
|
echo "$attachment"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
else
|
else
|
||||||
notify-send "Text type."
|
read -r -p "$(echo -n "Your clipboard contains $(wl-paste), which will be attached as a file path. Confirm (y/n): " >&2)" confirm
|
||||||
|
case "$confirm" in
|
||||||
|
y)
|
||||||
wl-paste
|
wl-paste
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
Videos /home/fic/Videos/ v
|
Videos /home/fic/Videos/ v
|
||||||
Videos /home/fic/Videos v
|
Videos /home/fic/Videos v
|
||||||
SyncDocuments /home/fic/SyncDocuments s
|
|
||||||
SyncDocuments /home/fic/SyncDocuments/ s
|
SyncDocuments /home/fic/SyncDocuments/ s
|
||||||
|
SyncDocuments /home/fic/SyncDocuments s
|
||||||
Pictures /home/fic/Pictures p
|
Pictures /home/fic/Pictures p
|
||||||
Pictures /home/fic/Pictures/ p
|
Pictures /home/fic/Pictures/ p
|
||||||
Downloads /home/fic/Downloads/ D
|
|
||||||
Downloads /home/fic/Downloads D
|
Downloads /home/fic/Downloads D
|
||||||
Documents /home/fic/Documents d
|
Downloads /home/fic/Downloads/ D
|
||||||
Documents /home/fic/Documents/ d
|
Documents /home/fic/Documents/ d
|
||||||
|
Documents /home/fic/Documents d
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue