diff options
author | cos <cos> | 2015-03-27 09:25:29 +0100 |
---|---|---|
committer | cos <cos> | 2015-04-04 13:28:19 +0200 |
commit | 3790aea465a8ceb737421d56d836bd0200770e04 (patch) | |
tree | 099eb35b82f98fac3b8f1fb255153cdf723582b6 | |
parent | ebc7c4bc27694c25bd96806c2795f763e2273abb (diff) | |
download | mat-3790aea465a8ceb737421d56d836bd0200770e04.zip |
Make papersize.sh output papersize & fullname of papersize.
-rwxr-xr-x | papersize.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/papersize.sh b/papersize.sh index 475bf4d..a05b396 100755 --- a/papersize.sh +++ b/papersize.sh @@ -1,12 +1,16 @@ #!/bin/zsh -e -PAPERSIZE=`lpoptions -p lbla -l|sed --silent 's/^PageSize.*\*//p'` +PAPERSIZE=`lpoptions -p lbla -l|sed --silent 's/^PageSize.*\*\([^ ]*\).*/\1/p'` +FULLNAME=`rgrep "$PAPERSIZE" /etc/cups 2>/dev/null| + sed --silent 's/.*PaperDimension\(.*\):.*["]\([0-9.[:blank:]]*\)"/\1/p'` DIMENSIONS=`rgrep "$PAPERSIZE" /etc/cups 2>/dev/null| sed --silent 's/.*PaperDimension.*["]\([0-9.[:blank:]]*\)"/\1/p'` MARGINS=`rgrep "$PAPERSIZE" /etc/cups 2>/dev/null| sed --silent 's/.*ImageableArea.*["]\([0-9.[:blank:]]*\)"/\1/p'` +echo "Papersize: $PAPERSIZE" +echo "Fullname: $FULLNAME" echo "Dimensions in postscript points: $DIMENSIONS" echo "Margins in postscript points: $MARGINS" |