summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcos <cos>2014-11-21 21:43:48 +0100
committercos <cos>2014-11-21 21:47:40 +0100
commit957c73087d6b090de5dc8953adc7086cac6641ec (patch)
treee899e13d77eee5b1d4d3f3fd01a806f7454bd3b5
parent9a9ccd11e0fe68232cc605f9bfdd883f4c0afe4f (diff)
downloadmat-957c73087d6b090de5dc8953adc7086cac6641ec.zip
Use a config file instead of hard coding everything.
-rwxr-xr-xmat5
1 files changed, 4 insertions, 1 deletions
diff --git a/mat b/mat
index 2f103db..382f003 100755
--- a/mat
+++ b/mat
@@ -3,6 +3,7 @@
use warnings;
use strict;
+use Config::Simple;
use DBI;
use DateTime;
use DateTime::Format::ISO8601;
@@ -11,6 +12,8 @@ use GD::Barcode;
use GD::Barcode::QRcode;
use Text::Iconv;
+tie my %Config, "Config::Simple", '/etc/mat.conf';
+
use constant LABEL_NAME => `sed --silent 's/^label_name //p' < config|tr -d '\\n'`;
use constant LABEL_ID_PREFIX => `sed --silent 's/^label_id_prefix //p' < config|tr -d '\\n'`;
@@ -340,7 +343,7 @@ sub print_label {
open(PNGFILE, ">label.png");
print PNGFILE $label->png;
- system("convert -density 300 label.png label.ps && lp -d QL-720NW label.ps");
+ system($Config{'print_command'});
}
sub cmd_storeportion {