1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-16 07:58:04 +00:00
freebsd-ports/x11/printscreen/files/printscreen.in
Felippe de Meirelles Motta be2beeff4e printscreen - Simple screenshot program for X11.
PR:		ports/125369
Submitted by:	Alex Kozlov <spam@rm-rf.kiev.ua>
Approved by:	gabor (mentor, implicit)
2008-07-26 17:02:59 +00:00

14 lines
289 B
Bash

#!/bin/sh
PATH=/bin:/usr/local/bin
STOREDIR="${HOME}/.screenshots"
SHOTDATE="$(date +%Y.%m.%d-%H.%M.%S)"
SHOTNAME="${STOREDIR}/screenshot-${SHOTDATE}.png"
if [ ! -d "${STOREDIR}" ]; then
mkdir "${STOREDIR}"
fi
xwd -root | xwdtopnm 2>/dev/null | pnmtopng 2>/dev/null > "${SHOTNAME}"