Align shell style all over the repo

This commit is contained in:
Lucas 2020-05-03 14:47:27 +00:00
parent afb13d9c9c
commit d5e71c46f7
16 changed files with 113 additions and 86 deletions

View file

@ -1,6 +1,6 @@
#!/bin/sh
# screenshot
# Written in 2019 by Lucas
# Written in 2019-2020 by Lucas
# CC0 1.0 Universal/Public domain - No rights reserved
#
# To the extent possible under law, the author(s) have dedicated all
@ -31,14 +31,16 @@ err()
case $# in
0) set -- -root
;;
1) [ "$1" = "-window" ] || err "Unknown option \"$1\"."
1) [ "$1" = "-window" ] || err "unknown option $1"
set --
;;
2) [ "$1" = "-id" ] || [ "$1" = "-name" ] || err "Unknown option \"$1\"."
[ -n "$2" ] || err "$1 expects a non-empty parameter."
2) [ "$1" = "-id" ] || [ "$1" = "-name" ] || err "unknown option $1"
[ -n "$2" ] || err "$1 expects a non-empty parameter"
;;
*) usage
;;
esac
xwd -silent "$@" | xwdtopnm | pnmtopng >~/media/ss/"$(date +%Y%m%d-%H%M%S)".png
: ${SCREENSHOTS:=~/media/ss}
xwd -silent "$@" | xwdtopnm |
pnmtopng >"$SCREENSHOTS/$(date +%Y%m%d-%H%M%S).png"