Created
December 28, 2022 03:04
-
-
Save pveierland/cce738fac048cee4b538072cb06ba922 to your computer and use it in GitHub Desktop.
slurp_align.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Usage: `slurp_align <divisor>`, e.g. `slurp_align 2` will align slurp width + height to multiple of 2 | |
slurp_align() { | |
slurp | awk "{split(\$0, loc_size); split(loc_size[2], size, \"x\"); print loc_size[1] \" \" (size[1] - (size[1] % ${1:-1})) \"x\" (size[2] - (size[2] % ${1:-1}));}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment