🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #23857

Re: xterm Cut Buffer

#23857
From: Peter Andersen
Date: Wed, 19 Jun 1991 14:05
55 lines
1852 bytes
In article <9106180214.AA01964@lightning.McRCIM.McGill.EDU> mouse@lightning.mcrcim.mcgill.EDU (der Mouse) writes:
[an original questioners question which has expired here:]
>> At the moment, to print highlighted text in an xterm, I use something
>> like
>
>> cat > tmp  [RETURN] [click middle mouse button] [RETURN] [CTRL-D]
>> lpr tmp
>[...]
>> Is there a better way?

I made the following program and uses it like this, from e.g. mu TWM menus:

   xcutbuffer | lpr

-----------

/* include files */
#include <stdio.h>              /* /usr/include/stdio.h */

/* X include files */
#include <X11/Xlib.h>		/* /usr/include/X11/Xlib.h  */

main(argc, argv)
     int argc;
     char **argv;
{
  
  /* Declarations */
  Display *dpy;           /* current display */
  int nbytes_return;
  char *bytes_return;

  
  /* Initialization */
  dpy = XOpenDisplay("");
  if ( !dpy ) {
    fprintf (stderr, "xcutbuffer: cannot establish display connection\n");
    exit(1);
  }
  
  bytes_return = XFetchBytes( dpy, &nbytes_return );
  printf("%s", bytes_return);

  /* Termination */
  XFree(bytes_return);
  XCloseDisplay ( dpy );
  exit (0);
} 


--------


Peter
Technical Details
Message-ID: <1991Jun19.140546.1108@daimi.aau.dk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!dkuug!daimi!datpete
References: <9106180214.AA01964@lightning.McRCIM.McGill.EDU> <1991Jun19.030547.27697@ipsa.reuter.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!dkuug!daimi!datpete
From: datpete@daimi.aau.dk (Peter Andersen)
Newsgroups: comp.windows.x
Subject: Re: xterm Cut Buffer
Message-ID: <1991Jun19.140546.1108@daimi.aau.dk>
Date: 19 Jun 91 14:05:46 GMT
References: <9106180214.AA01964@lightning.McRCIM.McGill.EDU> <1991Jun19.030547.27697@ipsa.reuter.com>
Sender: datpete@daimi.aau.dk (Peter Andersen)
Reply-To: datpete@daimi.aau.dk (Peter Andersen)
Organization: DAIMI: Computer Science Department, Aarhus University, Denmark
Lines: 55