#!/usr/bin/env bash # YES_ZSH scropt() { local now= which ~/sh/now 2>/dev/null >/dev/null && now=$(~/sh/now) || now=$(date +%F_%T) local fn="$HOME/play/$now.png" scrot "$fn" -e "optipng -quiet \$f" "$@" echo "$fn" } [ "${SOURCING:-0}" -gt 0 ] || scropt "$@"