2013-06-28 05:22:14 -07:00
|
|
|
#!/usr/bin/env bash
|
2021-07-29 00:37:35 -07:00
|
|
|
# YES_ZSH
|
2015-12-12 06:39:45 -08:00
|
|
|
|
2021-07-30 17:57:08 -07:00
|
|
|
#: $((SOURCING+=1))
|
2021-07-29 05:44:12 -07:00
|
|
|
#. ~/sh/now # FIXME: don't do this?
|
2021-07-30 17:57:08 -07:00
|
|
|
#: $((SOURCING-=1))
|
2021-07-29 05:44:12 -07:00
|
|
|
|
2021-07-30 17:57:08 -07:00
|
|
|
scropt() { ### @-
|
|
|
|
### run `scrot` through `optipng` and save the result to `~/play/$(now).png`.
|
|
|
|
###
|
|
|
|
### `$ ~/sh/sc $(~/sh/scropt -s -d0.5)`
|
2021-07-29 05:44:12 -07:00
|
|
|
local now=$(now)
|
|
|
|
[ $? -eq 0 ] || return $?
|
2016-03-12 07:04:43 -08:00
|
|
|
local fn="$HOME/play/$now.png"
|
|
|
|
scrot "$fn" -e "optipng -quiet \$f" "$@"
|
2021-07-29 05:44:12 -07:00
|
|
|
[ $? -eq 0 ] && echo "$fn" || return $?
|
2015-12-12 06:39:45 -08:00
|
|
|
}
|
2021-07-29 00:37:35 -07:00
|
|
|
|
|
|
|
[ "${SOURCING:-0}" -gt 0 ] || scropt "$@"
|