acpi: Narrow workaround for broken interrupt settings
[dragonfly.git] / share / examples / printing / make-ps-header
blob19e38ab7c779431e566a5800f65cc9dc4eae7827
1 #!/bin/sh
3 # make-ps-header - make a PostScript header page on stdout
4 # Installed in /usr/local/libexec/make-ps-header
8 # These are PostScript units (72 to the inch). Modify for A4 or
9 # whatever size paper you are using:
11 page_width=612
12 page_height=792
13 border=72
16 # Check arguments
18 if [ $# -ne 3 ]; then
19 echo "Usage: `basename $0` <user> <host> <job>" 1>&2
20 exit 1
24 # Save these, mostly for readability in the PostScript, below.
26 user=$1
27 host=$2
28 job=$3
29 date=`date`
32 # Send the PostScript code to stdout.
34 exec cat <<EOF
35 %!PS
38 % Make sure we do not interfere with user's job that will follow
40 save
43 % Make a thick, unpleasant border around the edge of the paper.
45 $border $border moveto
46 $page_width $border 2 mul sub 0 rlineto
47 0 $page_height $border 2 mul sub rlineto
48 currentscreen 3 -1 roll pop 100 3 1 roll setscreen
49 $border 2 mul $page_width sub 0 rlineto closepath
50 0.8 setgray 10 setlinewidth stroke 0 setgray
53 % Display user's login name, nice and large and prominent
55 /Helvetica-Bold findfont 64 scalefont setfont
56 $page_width ($user) stringwidth pop sub 2 div $page_height 200 sub moveto
57 ($user) show
60 % Now show the boring particulars
62 /Helvetica findfont 14 scalefont setfont
63 /y 200 def
64 [ (Job:) (Host:) (Date:) ] {
65 200 y moveto show /y y 18 sub def
66 } forall
68 /Helvetica-Bold findfont 14 scalefont setfont
69 /y 200 def
70 [ ($job) ($host) ($date) ] {
71 270 y moveto show /y y 18 sub def
72 } forall
75 % That is it
77 restore
78 showpage
79 EOF