dotfiles/home/default/.local/bin/convert-paste-png.sh

11 lines
328 B
Bash
Raw Normal View History

#!/bin/sh
wl-paste -t image > /tmp/convert-paste-png.data
#convert /tmp/convert-paste-png.data -format png "$1"
case "$(file --dereference --brief --mime-type -- "/tmp/convert-paste-png.data")" in
image/jpg|image/jpeg) convert /tmp/convert-paste-png.data -format png "$1" ;;
image/png) wl-paste -t image/png > "$1" ;;
esac