#!/bin/env bash # File to write the path # temp="$1" # 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 notify-send "Non-text type." temp=$(mktemp) wl-paste > temp grep -E "^$(wl-paste --list-types)" /etc/mime.types | awk '{print $2}' # echo "$temp" else notify-send "Text type." wl-paste fi