LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-01-2012, 08:21 AM   #1
kubas
LQ Newbie
 
Registered: Jun 2005
Posts: 2

Rep: Reputation: 0
multiple printers - default printer for a single program


Hi guys

I cannot find any help concerning following problem.
I have a network with 2 network printers. I would like to make printer 1 as a default printer for a program 1 (lets say accounting program) and printer 2 as a default for other programs.
I can set a default printer for the whole system, I know that, but I do want to have special programs to use defaultly another printer without changing the printer by hand.
I am running ubuntu 10.10.
Thanks
 
Old 04-01-2012, 09:47 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
An easy way to do this is to use the LPDEST environment variable.

If you want all applications to go to a specific printer, you can set LPDEST in a little executable shell program in /etc/profile.d, something like this
Code:
#!/bin/sh
export LPDEST=printer2
Then, to set LPDEST to printer1 for program1, you can create a little "launcher"
Code:
#!/bin/sh
export LPDEST=print1; program1
You would execute this from a command line in a terminal window.

And, of course, you can set a system-wide default printer in CUPS to avoid the above but it's worth knowing that you can do it this way too.

You may also, if your application has a config file, put the export line in there (maybe, maybe not).

Another approach might be the properties of the desktop icon you launch program1 with, perhaps
Code:
LPDEST=print1; program1
Doing that would vary by whatever window manager you're using (GNOME, KDE, XFCE) and you'd probably need to dig into the documentation (or just try it!).

The nice thing about using LPDEST is that it will only be in effect for program1; when program1 dies, so does the environment setting.

Hope this helps some.
 
1 members found this post helpful.
Old 04-01-2012, 11:16 AM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
If you are using CUPS print server, you have another option. CUPS allows you to set up several virtual printers while having only one (or two in your case) physical printers.

Go into CUPS administration as root, and configure a printer definition (use the Add Printer option). Name it Accounting (or whatever you want) and configure it as you want. When you are done, configure another printer definition for the print options you want for other applications.

When it comes time to print, on the File -> Print page, select the printer named Accounting instead of the default and do your printing. For other print jobs, select the other printer definition.

I have my CUPS set up with twelve virtual printers: 6 each in landscape and portrait, setting draft greyscale, normal, letter quality, draft color, normal, and photo quality. The only things I need to select before printing are the number of copies I want, and which virtual printer to use.
 
Old 04-01-2012, 04:42 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,997

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
Some programs can be set to exclude the global printer.
 
Old 04-02-2012, 12:51 AM   #5
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,772
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by bigrigdriver View Post
If you are using CUPS print server, you have another option. CUPS allows you to set up several virtual printers while having only one (or two in your case) physical printers.
...
When it comes time to print, on the File -> Print page, select the printer named Accounting instead of the default and do your printing. For other print jobs, select the other printer definition.
...
You can also configure CUPS such that one or more virtual printers -- actually a print job queue -- selects a specified real printer to make paper. For example, you could send Shipping and Receiving to physical printer Warehouse; Accounting to any of Books1, Books2, or Books3 (least busy); and so on.

Another approach uses group membership and permissions...

~~~ 0;-Dan
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple X-servers, multiple graphics adapters, single-seat (kind of tutorial) bluebox Linux - Desktop 6 06-07-2017 08:20 AM
LXer: Actual damages for single unauthorized download of software program held to be cost of single LXer Syndicated Linux News 0 12-31-2011 04:01 PM
creating multiple user in multiple linux boxes from single remote host niaz_ph Linux - Newbie 3 09-12-2011 03:48 PM
Default paper size for new printers arizonagroovejet Linux - General 1 10-23-2009 10:36 PM
Adding Multiple Printers - AS 3.0 skondolf Linux - Hardware 0 11-06-2004 07:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration