Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to copy text from a console?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Royle
Apprentice
Apprentice


Joined: 21 Jul 2004
Posts: 223

PostPosted: Tue Nov 09, 2004 12:19 am    Post subject: How to copy text from a console? Reply with quote

I'm wondering if its possible and how to copy text from a console (xterm) and paste it into another program like firefox. Thanks in advance for your help!
Back to top
View user's profile Send private message
michaelarch
Tux's lil' helper
Tux's lil' helper


Joined: 08 May 2003
Posts: 87
Location: Huntsville, AL

PostPosted: Tue Nov 09, 2004 1:08 am    Post subject: Reply with quote

Hello,
Try this forum......Hope it helps.

https://forums.gentoo.org/viewtopic.php?t=241801&highlight=xterm+copy+paste[/url]
Back to top
View user's profile Send private message
MagnusBerg
Guru
Guru


Joined: 07 Oct 2003
Posts: 370
Location: Burgsvik, Gotland, Sweden

PostPosted: Tue Nov 09, 2004 4:38 pm    Post subject: Reply with quote

I use GClipper. I just select the text with the mouse and it's there in GClippers memory to paste out with the middle mousebutton. It can save a lot of clips in it's memory and I have never filled it up.
emerge gclipper :-)
Back to top
View user's profile Send private message
teknomage1
Veteran
Veteran


Joined: 05 Aug 2003
Posts: 1239
Location: Los Angeles, CA

PostPosted: Tue Nov 09, 2004 11:36 pm    Post subject: Reply with quote

I wrote a perl script using the DCOP module from the KDE project that let's you pipe a command's ouput directly into klipper.
Code:
#!/usr/bin/perl -w
use DCOP;

#connect and register with DCOP
$dcop_client = new DCOP;
$dcop_client->attach();

#create a klipper object
$klip_obj = $dcop_client->createObject("klipper", "klipper");

#grab our data
my @clipboard_lines;
while(<>)
{
   chomp($line = $_);
        push(@clipboard_lines, $line);
}
$lines = join("\n", @clipboard_lines);


#use the klipper object to put our data in the clipboard
$klip_obj->setClipboardContents("$lines");

#unregister with DCOP like a good citizen
$dcop_client->detach();

save that in /usr/local/bin as sklip and then call it from the command line like this.
Code:
cat ~/bin/sklip |sklip
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum