nixos-config/user/app/doom-emacs/scripts/copy-link-or-file/copy-link-or-file-to-clipboard.sh
2023-06-15 18:27:06 -05:00

10 lines
202 B
Bash
Executable file

#!/bin/sh
if [[ -f "$1" ]]; then
TYPE=$(file -b --mime-type "$1")
xclip -selection clipboard -t "$TYPE" -i "$1"
else
echo $1 | xclip -selection clipboard -t text/plain &> /dev/null
exit
fi
exit