--- modules/printbackends/lpr/gtkprintbackendlpr.c.orig	2009-01-08 01:33:32.000000000 +0900
+++ modules/printbackends/lpr/gtkprintbackendlpr.c	2009-03-02 15:18:40.000000000 +0900
@@ -26,6 +26,7 @@
 #include <fcntl.h>
 #include <stdlib.h>
 #include <string.h>
+#include <stdio.h>
 
 #include <errno.h>
 #include <cairo.h>
@@ -333,6 +334,9 @@
   cmd_line = gtk_print_settings_get (settings, "lpr-commandline");
   if (cmd_line == NULL)
     cmd_line = LPR_COMMAND;
+
+  printf("cmd_line -> %s -P%s\n"
+	 , cmd_line, gtk_printer_get_name(printer) );
   
   ps = g_new0 (_PrintStreamData, 1);
   ps->callback = callback;
@@ -393,17 +397,60 @@
 {
   GtkPrinter *printer;
 
-  printer = gtk_printer_new (_("Print to LPR"),
-			     GTK_PRINT_BACKEND (backend),
-			     TRUE); 
-  gtk_printer_set_has_details (printer, TRUE);
-  gtk_printer_set_icon_name (printer, "gtk-print");
-  gtk_printer_set_is_active (printer, TRUE);
-  gtk_printer_set_is_default (printer, TRUE);
 
-  gtk_print_backend_add_printer (GTK_PRINT_BACKEND (backend), printer);
-  g_object_unref (printer);
+  gchar *lprlist_fname;
+  FILE *file;
+  char printer_name[BUFSIZ];
+  int  fl_default;
+
+  lprlist_fname = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "lpr_list", NULL);
+  file=fopen(lprlist_fname,"r") ;
+
+  if( !file ){
+    printf("open error %s\n", lprlist_fname );
+
+    printer = gtk_printer_new (_("LPR"),
+			       GTK_PRINT_BACKEND (backend),
+			       TRUE); 
+    gtk_printer_set_has_details (printer, TRUE);
+    gtk_printer_set_icon_name (printer, "gtk-print");
+    gtk_printer_set_is_active (printer, TRUE);
+    gtk_printer_set_is_default (printer, TRUE);
+
+    gtk_print_backend_add_printer (GTK_PRINT_BACKEND (backend), printer);
+    g_object_unref (printer);
+    gtk_print_backend_set_list_done (GTK_PRINT_BACKEND (backend));
+
+    g_free(lprlist_fname);
+
+    return;
+
+  }
+
+  while( fscanf(file,"%s %d", printer_name, &fl_default ) != EOF ){
+
+    printer = gtk_printer_new (_(printer_name),
+			       GTK_PRINT_BACKEND (backend),
+			       TRUE); 
+    gtk_printer_set_has_details (printer, TRUE);
+    gtk_printer_set_icon_name (printer, "gtk-print");
+    gtk_printer_set_is_active (printer, TRUE);
+    if ( fl_default == 0 )
+      gtk_printer_set_is_default (printer, TRUE);
+    else
+      gtk_printer_set_is_default (printer, FALSE);
+
+    gtk_print_backend_add_printer (GTK_PRINT_BACKEND (backend), printer);
+    g_object_unref (printer);
+
+  }
+
   gtk_print_backend_set_list_done (GTK_PRINT_BACKEND (backend));
+
+  g_free(lprlist_fname);
+
+  fclose(file);
+
 }
 
 static GtkPrinterOptionSet *
@@ -417,6 +464,12 @@
   const char *command;
   char *n_up[] = {"1", "2", "4", "6", "9", "16" };
 
+  char lprcmd[BUFSIZ];
+  if ( strcmp(gtk_printer_get_name(printer),"LPR") == 0 )
+    sprintf(lprcmd,"%s",LPR_COMMAND);
+  else
+    sprintf(lprcmd,"%s -P%s",LPR_COMMAND,gtk_printer_get_name(printer));
+
   set = gtk_printer_option_set_new ();
 
   option = gtk_printer_option_new ("gtk-n-up", _("Pages Per Sheet"), GTK_PRINTER_OPTION_TYPE_PICKONE);
@@ -432,7 +485,7 @@
       (command = gtk_print_settings_get (settings, "lpr-commandline"))!= NULL)
     gtk_printer_option_set (option, command);
   else
-    gtk_printer_option_set (option, LPR_COMMAND);
+    gtk_printer_option_set (option, lprcmd);
   gtk_printer_option_set_add (set, option);
     
   return set;
--- modules/printbackends/lpr/Makefile.am.orig	2009-01-08 01:33:32.000000000 +0900
+++ modules/printbackends/lpr/Makefile.am	2009-03-02 15:00:41.000000000 +0900
@@ -11,6 +11,7 @@
 	-I$(top_srcdir)/gdk				\
 	-I$(top_builddir)/gdk				\
 	-DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED		\
+	-DGTK_SYSCONFDIR=\"$(sysconfdir)\"              \
 	$(GTK_DEP_CFLAGS)				\
 	$(GTK_DEBUG_FLAGS)
 
--- modules/printbackends/lpr/Makefile.in.orig	2009-01-08 06:52:13.000000000 +0900
+++ modules/printbackends/lpr/Makefile.in	2009-03-02 15:01:53.000000000 +0900
@@ -416,6 +416,7 @@
 	-I$(top_srcdir)/gdk				\
 	-I$(top_builddir)/gdk				\
 	-DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED		\
+	-DGTK_SYSCONFDIR=\"$(sysconfdir)\"              \
 	$(GTK_DEP_CFLAGS)				\
 	$(GTK_DEBUG_FLAGS)
 
