lessdisks - local peripherals

set printer to be used according to terminal location

set printer to be used according to terminal location

One might use a script to set the environment variable $PRINTER when a user logs in. All native x applications will honor $PRINTER and will take the printer specified als default whereas (all? most?) KDE applications (and OpenOffice too) will store the printer that was used last time as default. So be aware of this and explain it to users. Look at this example:
(to download it: go to "Files/scripts and debs" in the menu at the right upper corner of this page )

#!/bin/sh
#
# /usr/local/set_printer
# set the printer name for a terminal
# schweer, 2002; adapted to be useable with lessdisks jan 2005
# call this script when a user logs in, e.g. in /etc/X11/Xsession on the xapp server
#
REMOTE_HOST="`echo $DISPLAY | cut -d\":\" -f1| cut -d\".\" -f1`"

case "$REMOTE_HOST" in

# terminals room 107, IBM Lexmark 4029 030, attached to a simple printserver box
inf11|inf12|inf13|inf14|inf15|inf16|inf17)
PRINTER=print107
;;
# terminals room 106, IBM Lexmark 4029 030, attached to freesco router (i386, 8MB)
inf21|inf22|inf23|inf24|inf25|inf26|inf27|inf28|inf29|inf30|inf31)
PRINTER=print106
;;
# terminals room 105, people have to use the printer in room 106
inf40|inf41|inf42|inf43|inf44|inf45|inf46|inf47|inf48)
PRINTER=print106
;;
# terminals room sl (self learning center), postscript printer HP 2200
sl01|sl03|sl04|sl05|sl06|sl07|sl08|sl09|sl10|sl11|sl12|sl13)
PRINTER=printsl
;;
sl14|sl15|sl16|sl17|sl18|sl19|sl20|sl21|sl22|sl23|sl24|sl25)
PRINTER=printsl
;;
# default value for XDM-server and terminal not included above
*)
PRINTER=lp
esac
export $PRINTER