aboutsummaryrefslogtreecommitdiff
path: root/stuff/webpkiller/webpkiller.sh
diff options
context:
space:
mode:
authorHannah Isopod <me@bathynomus.xyz>2025-05-10 03:03:58 -0600
committerHannah Isopod <me@bathynomus.xyz>2025-05-10 03:03:58 -0600
commiteb61c1bae2ffad114e17393d91d86fb00d7ac8cd (patch)
tree4f997d73e0843dab760e5d988679a1a86b76f5da /stuff/webpkiller/webpkiller.sh
parent4b9500ddeedbea21f80f41dfe4149cf3bf9be4c3 (diff)
Initialer commit
Just remade the repo because I don't *need* need a comprehensive source history for my personal website and this is easier than getting filter-repo to work good
Diffstat (limited to 'stuff/webpkiller/webpkiller.sh')
-rw-r--r--stuff/webpkiller/webpkiller.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/stuff/webpkiller/webpkiller.sh b/stuff/webpkiller/webpkiller.sh
new file mode 100644
index 0000000..017fba0
--- /dev/null
+++ b/stuff/webpkiller/webpkiller.sh
@@ -0,0 +1,20 @@
+#!/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