1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-05-20 10:53:23 -07:00
rc/sh/scropt

22 lines
489 B
Bash
Executable File

#!/usr/bin/env bash
# YES_ZSH
# YES_BASH
# YES_DASH
# YES_ASH
scropt() { ### @-
### run `scrot` through `optipng` and save the result to `~/play/$(now).png`.
###
### ```
### $ ~/sh/sc $(~/sh/scropt -s -d0.5)
### ```
local now= fn=
now="$(now)" || return
fn="$HOME/play/$now.png"
scrot "$fn" -e 'optipng -quiet $f' "$@" && echo "$fn"
}
[ -n "${preload+-}" ] || . ~/sh/preload || exit 2
eval ${preload:-preload} now
[ -n "${preload+-}" ] || scropt "$@"