#!/bin/sh if [[ "$1" == *.png ]]; then xclip -selection clipboard -target image/png -i $1 elif [[ "$1" == *.jpg ]] || [[ "$1" == *.jpeg ]]; then xclip -selection clipboard -target image/jpeg -i $1 else bat "$1" | xclip -sel clip fi