mirror of
https://github.com/notwa/rc
synced 2024-11-05 02:59:03 -08:00
19 lines
499 B
Bash
Executable file
19 lines
499 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# YES_ZSH
|
|
|
|
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 $?
|
|
}
|
|
|
|
[ -n "${preload+-}" ] || . ~/sh/preload || exit 2
|
|
eval ${preload:-preload} now
|
|
[ -n "${preload+-}" ] || scropt "$@"
|