Adds shell function - copy file to system clipboard

This commit is contained in:
willemml 2023-11-30 12:41:41 -08:00
parent e25c0ee553
commit 9a08dcc333
Signed by: willemml
GPG key ID: C3DE5DF6198DACBD

View file

@ -42,6 +42,15 @@
else else
eval "$(/usr/local/bin/brew shellenv)" eval "$(/usr/local/bin/brew shellenv)"
fi fi
file-to-clipboard() {
filepath=$(realpath $1)
osascript \
-e 'on run args' \
-e "set the clipboard to POSIX file \"$filepath\"" \
-e end \
"$@"
}
''; '';
targets.darwin = { targets.darwin = {