13 lines
278 B
Bash
13 lines
278 B
Bash
#!/bin/sh
|
|
|
|
TIMESTAMP="$(date +%Y%m%d%H%M%S)"
|
|
TARGETBASE="$HOME/screenshots"
|
|
mkdir -p $TARGETBASE
|
|
FILENAME="$TARGETBASE/${TIMESTAMP}.png"
|
|
[ -d $targetbase ] || exit 1
|
|
scrot -s $FILENAME
|
|
|
|
if [[ -n $(type -p xclip) ]]; then
|
|
xclip -selection clipboard -t image/png $FILENAME
|
|
fi
|