Setting Default Printers in LTSP

Finding a way to have client default to the closest network printer was fairly simply after finding this post on the edubuntu mailing list…

This post suggested editing the /etc/profile logon script and adding something like this…

case `echo $DISPLAY | sed s/:.*$//` in

ws004) lpoptions -d printerA;;

ws005) lpoptions -d printerB;;


In this example ws004 is determined by the $DISPLAY variable. This is not useful in the Ubuntu version of ltsp and it was suggested in that post that I use $SSH_CLIENT instead. So after playing around with what the $SSH_CLIENT variable gave me I realized that I am not as familiar with sed as I am awk. So after realizing that $SSH_CLIENT gives me an IP address first and then some other information. I just used awk to print out the first section of the echo command like this…

case `echo $SSH_CLIENT | awk ‘{print $1}’` in lpoptions -d Room-220-Laser;; lpoptions -d Room-120-Laser;;



About Craig Szymanski

Systems Administrator Photography Enthusiast
This entry was posted in LTSP - Linux Terminal Server Project and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s