All pastes #442271 Raw Edit

Something

public text v1 · immutable
·published 2007-04-16 03:31 UTC
rendered paste body
#!/bin/bash

# Location to save files
WORKINGDIR=$HOME/screenshots
# Default delay before taking screenshots
DELAY=3
#Prefix to use for images captured.
PREFIX=screenshot

# Check if the dir to store the screenshots exists, else create it:
if [ ! -d "${WORKINGDIR}" ]; then mkdir "${WORKINGDIR}"; fi

i=`ls -l $WORKINGDIR/$PREFIX*.png | wc -l`
((i = i+1))

sleep $DELAY
import -window root $WORKINGDIR/$PREFIX-$i.png