mirror of
https://github.com/notwa/rc
synced 2024-11-12 15:59:02 -08:00
14 lines
405 B
Bash
Executable file
14 lines
405 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# compat: +ash +bash +dash +zsh
|
|
|
|
scropt() { ### @-
|
|
### run `scrot` through `optipng` and save the result to `~/play/$(now).png`.
|
|
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 "$@"
|