Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Anders Blomdell
packning-ombyggnad
Commits
292f33a9
Commit
292f33a9
authored
Jul 17, 2018
by
Anders Blomdell
Browse files
Use preferred printer if available
parent
e99dac43
Changes
2
Hide whitespace changes
Inline
Side-by-side
tools/print-content
View file @
292f33a9
#!/bin/sh
#!/bin/bash
if
[
-z
"
${
PRINTER
}
"
]
;
then
export
PRINTER
=
Forsberg
fi
if
[
$#
-ne
1
]
;
then
echo
"You need to specify pallet number"
1>&2
exit
1
fi
TARGET
=
"data/pall
$
1
"
TARGET
=
"data/pall
$
(
printf
'%03d'
$1
)
"
if
[
!
-f
"
${
TARGET
}
"
]
;
then
echo
"
${
TARGET
does not exist
}
"
1>&2
exit
1
fi
rst2pdf
-s
tools/pall.sty
${
TARGET
}
/dev/stdout |
PRINTER
=
Forsberg
lpr
rst2pdf
-s
tools/pall.sty
${
TARGET
}
/dev/stdout | lpr
tools/print-pallet-label
View file @
292f33a9
...
...
@@ -2,10 +2,14 @@
set
-e
if
[
-z
"
${
PRINTER
}
"
]
;
then
export
PRINTER
=
Forsberg
fi
if
[
$#
-ne
3
]
;
then
echo
"Run as
$0
FIRST LAST 'content origin'"
1>&2
echo
"
$0
1 10 'Robotkyrkogård'"
1>&2
exit
1
fi
$(
dirname
$0
)
/pallet-label
"
$@
"
|
PRINTER
=
Forsberg
lpr
$(
dirname
$0
)
/pallet-label
"
$@
"
| lpr
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment