dots


commit
0a164a5
parent
17dde9e
author
chasinglightning
date
2025-04-10 22:04:14 -0400 EDT
add some scripts
2 files changed,  +78, -0
A scripts/Scripts/gotify-desktop-script.sh
+4, -0
1@@ -0,0 +1,4 @@
2+until gotify-desktop; do
3+    echo "'gotify' crashed with exit code $?.  Respawning.." >&2
4+    sleep 1
5+done
A scripts/Scripts/resizecropspring.sh
+74, -0
 1@@ -0,0 +1,74 @@
 2+#!/bin/bash
 3+#
 4+# quick script to make variants for animated retrospring icons or headers and direct upload to replace a user's existing ones. good for when a user wants to use a specific gif but carrierwave processing glitches it somehow
 5+#
 6+# deps: charmbracelet/gum, imagemagick
 7+
 8+filename=$(gum input --placeholder "without an extension")
 9+
10+echo -e "header or icon \n"
11+
12+CHOOSE=$(gum choose --limit 1 "header" "icon")
13+
14+echo -e "you chose ${CHOOSE} \n"
15+
16+echo -e "making dirs \n"
17+
18+if [ "${CHOOSE}" == "header" ]; then
19+	mkdir web mobile retina original
20+elif [ "${CHOOSE}" == "icon" ]; then
21+	mkdir large medium small original
22+else
23+	echo -e "mkdir failed for some reason"
24+fi
25+
26+echo -e "dirs made \n"
27+
28+echo -e "copying original from workdir to dedicated folder \n"
29+
30+cp ./$filename.gif ./original/$filename.gif
31+
32+echo -e "move done \n"
33+
34+ORIGW=$(identify -format '%w' ./original/$filename.gif[0])
35+ORIGH=$(identify -format '%h' ./original/$filename.gif[0])
36+
37+echo -e "making mobile version \n"
38+
39+if [ "${CHOOSE}" == "header" ]; then
40+	magick -size $ORIGWx$ORIGH^ ./original/$filename.gif -coalesce -resize 450x105^ /tmp/tmp-header-mobile.gif && magick /tmp/tmp-header-mobile.gif -gravity center -crop 450x105+0+0 +repage ./mobile/$filename.gif
41+	
42+	echo -e "mobile done \n"
43+
44+	echo -e "making retina version \n"
45+
46+	magick -size $ORIGWx$ORIGH^ ./original/$filename.gif -coalesce -resize 900x210^ /tmp/tmp-header-retina.gif && magick /tmp/tmp-header-retina.gif -gravity center -crop 900x210+0+0 +repage ./retina/$filename.gif
47+
48+	echo -e "retina done \n"
49+
50+	echo -e "making web version \n"
51+
52+	magick -size $ORIGWx$ORIGH^ ./original/$filename.gif -coalesce -resize 1500x350^ /tmp/tmp-header-web.gif && magick /tmp/tmp-header-web.gif -gravity center -crop 1500x350+0+0 +repage ./web/$filename.gif
53+
54+	echo -e "web done \n"
55+elif [ "${CHOOSE}" == "icon" ]; then
56+	magick -size $ORIGWx$ORIGH^ ./original/$filename.gif -coalesce -resize 80x80^ /tmp/tmp-icon-small.gif && magick /tmp/tmp-icon-small.gif -gravity center -crop 80x80+0+0 +repage ./small/$filename.gif
57+	
58+	echo -e "small done \n"
59+
60+	echo -e "making medium version \n"
61+
62+	magick -size $ORIGWx$ORIGH^ ./original/$filename.gif -coalesce -resize 256x256^ /tmp/tmp-icon-medium.gif && magick /tmp/tmp-icon-medium.gif -gravity center -crop 256x256+0+0 +repage ./medium/$filename.gif
63+
64+	echo -e "medium done \n"
65+
66+	echo -e "making large version \n"
67+
68+	magick -size $ORIGWx$ORIGH^ ./original/$filename.gif -coalesce -resize 500x500^ /tmp/tmp-icon-large.gif && magick /tmp/tmp-icon-large.gif -gravity center -crop 500x500+0+0 +repage ./large/$filename.gif
69+
70+	echo -e "large done \n"
71+else
72+	echo -e "img creation failed for some reason idk"
73+fi
74+
75+echo -e "script done"