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 02-23-2005, 04:57 PM   #1
drj000
Member
 
Registered: Sep 2004
Location: Houston, TX
Distribution: Fedora
Posts: 261

Rep: Reputation: 33
Read clipboard from console


Ok here's what I want to do. I just downloaded a console-based download accelator (Axel), and I want to be able to copy a link in Firefox, then type a specific key combination which will pop open an xterm with axel downloading the file. My problem is, I can't figure out how to get a console program to read the clipboard.
I did find mention of one program called wpaste (I could use it with the command 'axel $(wpaste)'), that used to come with WindowMaker, but doesn't seem to anymore. RPM find says it's in windowmaker 0.81, I think, but I have WindowMaker 0.91, and I don't have it. And I really don't want to downgrade my version of WindowMaker (even though I only occasionally use it).
So, does anyone know anyway for the console to be able to read the clipboard in the way I've described?
 
Old 02-23-2005, 08:28 PM   #2
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
hi,
these are some fairly interesting utilities
http://cvs.windowmaker.org/co.php/wm/util/wxpaste.c
just put the source code in a clean directory and comment out
// #include "../src/config.h"
and compile with
gcc -o wxpaste -L/usr/X11R6/lib -lX11 wxpaste.c
it doesn't need any of windowmaker
however i don't think this is going to do what you want
it only seems to grab stuff from the same term it's run in ?
also appears to grap emacs yanks
but not copy from qt or gtk apps
there might be something i'm missing and i'm abslutely sure it could be easily fixed to use
qt or gtk paste as a command line option


just for fun you might mess with it and see if you can get it to do more

Last edited by foo_bar_foo; 02-23-2005 at 08:41 PM.
 
Old 02-23-2005, 11:00 PM   #3
drj000
Member
 
Registered: Sep 2004
Location: Houston, TX
Distribution: Fedora
Posts: 261

Original Poster
Rep: Reputation: 33
Quote:
Originally posted by foo_bar_foo
gcc -o wxpaste -L/usr/X11R6/lib -lX11 wxpaste.c
it doesn't need any of windowmaker
however i don't think this is going to do what you want
it only seems to grab stuff from the same term it's run in ?
Yeah, I've got wxpaste, and wxcopy. As you say, it only copies and pastes from one terminal. It doesn't interact with the X clipboard. Thanks for the suggestion, though.
Luckily, I finally found what I was looking for a little while before you posted. It's called xclip. It copies from stdin to the X-clipboard, and pastes from the X-clipboard to stdout. It's exactly what I needed. Now I'll just have to write a script to tell it where to download the files according to their extension. That won't be too hard.
 
  


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
Local Console = Outlin/box borken, I cant read kernel menu Adylas Linux - Software 0 08-12-2005 10:46 AM
Read KDE clipboard content neranjana Linux - General 3 05-10-2005 12:12 PM
read Video from Card on console Anayet Programming 6 08-17-2004 09:36 AM
read console users dukeinlondon Linux - Software 1 01-15-2004 05:40 PM
Compiled RH7.3 to read WinXP NTFS partition, mounts in Console, but can't mount fstab BlackDogg Linux - Newbie 20 08-05-2002 11:15 PM

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

All times are GMT -5. The time now is 05:46 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