1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-06-26 01:07:11 -07:00

update scropt (though it's still untested)

This commit is contained in:
Connor Olding 2021-10-05 10:58:03 -07:00
parent 581fd63321
commit b34bb36329

View File

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