[FreeNX-kNX] FreeNX 0.6.0.99 snapshot with full printing support and some bugs fixed

Fabian Franz FabianFranz at gmx.de
Fri Jan 26 04:41:58 UTC 2007


> On Wednesday 24 January 2007 22:45, Fabian Franz wrote:
> 
> >         * Added setting of CUPS_SERVER environment var.

> > -> But what about those KDE apps? First of all you can just enable 
> > ENABLE_KDE_CUPS="1" and are done with it. Second however you can 
> > use a more tricky approach if you want to work locally and remote 
> > at the same time with the same home directory:   
> > 
> > Use the following script and save it as for example 
> > /usr/bin/nxcupsd_getsock: 
> >
> > --
> > 
> > #!/bin/sh
> > 
> > if [ -n "$NXSESSIONID" -a -r "$HOME/.nx/C-$NXSESSIONID/cups/cups.sock" ]
> > then
> >         echo "$HOME/.nx/C-$NXSESSIONID/cups/cups.sock"
> > else
> >         echo "/var/run/cups/cups.sock"
> > fi
> > 
> > --
> > 
> > make it executable (chmod a+x /usr/bin/nxcupsd_getsock) and add the 
> > following entry to your global kdeprintrc: 
> > 
> > Host[$e]=$(/usr/bin/nxcupsd_getsock)
> > 
> > This means whenever we are running in an nxsession we will be redirected
> > to the right cupsd, else the system cupsd will be used. 
> 
> Nah, that solution is incomplete; it will *only* work in cases were 
> Unix domain socket printing is used for non-NX printing from KDE. 

This was just a general example. Of course different users have different
needs.

And I tend to just do something like:

... magically set KDEHOME ...

if [ -n "$CUPS_SERVER" ]
then
  echo $CUPS_SERVER
elif [ -f "$HOME/.cups/client.conf" ]
then
  ... # somehow get servername from config file
elif [ -S "/var/run/cups/cupsd.sock" ]
then
  echo "/var/run/cups/cupsd.sock"
elif grep -q Host= $KDEHOME/share/config/kdeprintrc
 ... #Use the users choice
else
# fallback to localhost
  echo "127.0.0.1"
fi

What about it?

> 
> > Isn't KDE great?
> 
> Beyond any doubt!  :-)

:-)

> Howver, I think it really should be made "immutable" in addition:
> 
>    Host[$ie]=$(/usr/bin/nxcupsd_getsock)

I agree but only if the users choice is honored as shown above ...
> 
> A key tagged as [$e] only be be set dynamically only once (like, for 
> the first login after installation of KDE: "Mail[$e]=$USER@$HOST"), 
> and may then be static from then on. 

And its mostly recomputed as soon as kbuildsycoca is run ...

> I think the kdeprintrc "Host" key should be made to be *always*
> dynamically set by those people who run NX sessions.

Yes.

> If it is not immutable, a user may be clicking his kprinter dialogs,
> and by accident set the value to a static one again, wondering for a 
> few days why his FreeNX printing stopped working, pull out his hair 
> and finally come to this list to complain.   :-)

Yeah, sure.

> > Future: I was thinking that one could do the same for a "immutable 
> > flat profile" to just disable all fancy things if running inside an 
> > NX session.  
>  
> Great idea!

I started the profile in svn/nx-utils/nxfastkde/ and as a nxserver is
seldom used as a workstation its enough to use kiosktool to create an
empty new profile and add the files to the share/config directory.

> > If you use the nxcupsd-wrapper script, which is also necessary to 
> > run the !M client with CUPS 1.2 it will automatically try to 
> > download the PPDs. If you don't have this or the script does not 
> > work do on the client something like:   
> >
> > $ cd ~/.nx/cups/
> > $ mkdir ppd
> > $ cd ppd
> > $ for i in $(lpstat -p | cut -d" " -f2 ); do 
> >         wget http://localhost:631/printers/$i.ppd -O ${i}_nxdl.ppd; 
> >   done  
> 
> This will spit error messages for all cases where CUPS "printer 
> instances" are in use; but these will be harmless.

Sure ...

If you have any better secret script to get the ppds from the cups server
go ahead :-).

Perhaps a patch to add directory listing for just /ppd ;-).

http://svn.berlios.de/svnroot/repos/freenx/nx-utils/nxcupsd-wrapper/nxcupsd-wrapper
> > Download it, put it somewhere in your home directory, chmod a+x 
> > nxcupsd-wrapper, and point nxclient to it instead of /usr/sbin/cupsd. 
> Isn't this renamed, elsewhere, to nxcups-wrapper (no "d")?

It was renamed in SVN.

cu

Fabian



More information about the FreeNX-kNX mailing list