-
Notifications
You must be signed in to change notification settings - Fork 2
/
timeout.sh
executable file
·39 lines (32 loc) · 782 Bytes
/
timeout.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# SCRIPT TO DO STUFF
POSITIONAL=()
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-f|--filename)
FILENAME="$2"
shift # past argument
shift # past value
;;
-t|--text)
TEXT="$2"
shift # past argument
shift # past value
;;
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
LOGOFILE=logos/timeout.png
LOGOGEO=-50-500
LOGOSCALE=50%
BGCOLOR="#D10101"
BOTTOMCOLOR="grey"
if [ ! -f "output/$FILENAME.png" ]; then
./apostle-gen.sh -f ${FILENAME} -t "${TEXT}" -l ${LOGOFILE} -g ${LOGOGEO} -s ${LOGOSCALE} -c ${BGCOLOR} -b ${BOTTOMCOLOR}
open "output/$FILENAME.png"
fi