1
0
Fork 0
isopod.cool/stuff/webpkiller/webpkiller.sh
2023-01-09 14:30:45 -07:00

21 lines
382 B
Bash

#!/bin/bash
if [ ! -f "$1" ]; then
echo "File $1 does not exist. Aborting..."
exit
fi
suffix=".webp"
filename=${1%"$suffix"}
outfile="$filename.png"
if [ -f "$outfile" ]; then
echo "File $outfile already exists. Aborting..."
notify-send --app-name=webpkiller "File $outfile already exists. Aborting..."
exit
fi
magick $1 $outfile
rm -rf $1
xdg-open $outfile