mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-24 10:02:29 +01:00
9f5e6023c1
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
23 lines
392 B
Bash
23 lines
392 B
Bash
#!/bin/sh
|
|
|
|
|
|
CAPTURE_TOOL=/usr/bin/import
|
|
if [ ! -x "${CAPTURE_TOOL}" ];then
|
|
echo "$0: couldn't run ${CAPTURE_TOOL}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
CAPTURE_PATH="${HOME}/spectrwm_capture_$(date +%FT%T).png"
|
|
|
|
case "$1" in
|
|
'full')
|
|
"${CAPTURE_TOOL}" -window root png:"${CAPTURE_PATH}"
|
|
;;
|
|
'window')
|
|
sleep 0.5
|
|
"${CAPTURE_TOOL}" png:"${CAPTURE_PATH}"
|
|
;;
|
|
*)
|
|
echo "$0: $0 <full | window>" >&2
|
|
;;
|
|
esac
|