aboutsummaryrefslogtreecommitdiffstats
path: root/ssl
blob: 91ff5c0862ad81861e635c56eb726425291d3b6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash

##
# Create a screenshot using maim, optipng it, then dump it in ~/dumpdir for
# dumpwatch to upload it to the appropriate server.
#
# This script requires dumpwatch to already be running.
#

set -o errexit

if [[ -z "$TMPDIR" ]]; then
	TMPDIR=/tmp
fi

file=$(mktemp -u XXXXXXXXXX.png)

maim -s "$TMPDIR"/"$file"
optipng "$TMPDIR"/"$file"

mv "$TMPDIR"/"$file" "$HOME"/dumpdir/"$file"