1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-13 20:49:03 -08:00
rc/sh/scropt
Connor Olding d5f3f14d72 merge compatibility lines
RIP meaningful last-modified dates
2024-03-26 15:08:14 -07:00

14 lines
409 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`.
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 "$@"