summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpapersize.sh6
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"