1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-06-29 02:17:12 -07:00
rc/sh/scropt

20 lines
480 B
Bash
Executable File

#!/usr/bin/env bash
# YES_ZSH
#: $((SOURCING+=1))
#. ~/sh/now # FIXME: don't do this?
#: $((SOURCING-=1))
scropt() { ### @-
### run `scrot` through `optipng` and save the result to `~/play/$(now).png`.
###
### `$ ~/sh/sc $(~/sh/scropt -s -d0.5)`
local now=$(now)
[ $? -eq 0 ] || return $?
local fn="$HOME/play/$now.png"
scrot "$fn" -e "optipng -quiet \$f" "$@"
[ $? -eq 0 ] && echo "$fn" || return $?
}
[ "${SOURCING:-0}" -gt 0 ] || scropt "$@"