Copy and paste (sort of) into the XO laptop's Terminal activity
According to ticket #5376, you can't copy and paste text between Terminal.activity and other applications. This became a problem for me this evening when I tried to copy a script from a web page into a file on the XO laptop. Fortunately, pygtk gives you access to the clipboard, and it's really easy to create a script that blasts the contents of the clipboard to stdout. I named it pbpaste after the Mac OS X utility of the same name. Save this file somewhere in your $PATH, make it executable, and you're all set.
#!/usr/bin/python import pygtk import gtk cb = gtk.clipboard_get(selection = "PRIMARY") print cb.wait_for_text()
It's not as flexible as a middle-click button would be, but it gets the job done, as shown in the figure above. And if I need to insert the contents of the clipboard into a file I'm editing in vi, I can always use :r!pbpaste
Posted by Brian Jepson |
Dec 20, 2007 01:58 PM
Education, Linux, olpc |
Permalink
| Comments (3)
Recent Entries
- Poromenos' hello world curve
- USB CapsLocker and Sun keyboard simulation
- Robosapien has a coil gun
- Faster Windows shutdown
- Assign USB drives to a folder
- Little drummer bot
- CSS ad blocking for Firefox and Safari
- Design Coding: web standards rap
- Shredz64: Guitar Hero for C64
- BATMAN: adhoc mesh routing
Comments
Newest comments listed first.
| Posted by: Gary LaPointe on December 23, 2007 at 2:46 PM |
So did you get your Sprint phone working as a modem?
| Posted by: Brian Jepson on January 9, 2008 at 6:38 AM |
Gary, I did finally get it working. I used the instructions here: http://www.evdoforums.com/thread3308.html
Bloggers
Welcome to the Hacks Blog!
Categories
- Ajax
- Amazon
- AppleTV
- Astronomy
- BlackBerry
- Blogging
- Body
- Cars
- Cryptography
- Data
- Education
- Electronics
- Energy
- Events
- Excel
- Excerpts
- Firefox
- Flash
- Flickr
- Flying Things
- Food
- Gaming
- Gmail
- Google Earth
- Google Maps
- Government
- Greasemonkey
- Hacks Series
- Hackszine Podcast
- Halo
- Hardware
- Home
- Home Theater
- iPhone
- iPod
- IRC
- iTunes
- Java
- Kindle
- Knoppix
- Language
- LEGO
- Life
- Lifehacker
- Linux
- Linux Desktop
- Linux Multimedia
- Linux Server
- Mac
- Mapping
- Math
- Microsoft Office
- Mind
- Mind Performance
- Mobile Phones
- Music
- MySpace
- MySQL
- NetFlix
- Network Security
- olpc
- OpenOffice
- Outdoor
- Parenting
- PDAs
- Perl
- Philosophy
- Photography
- PHP
- Pleo
- Podcast
- Podcasting
- Productivity
- PSP
- Retro Computing
- Retro Gaming
- Science
- Screencasts
- Shopping
- Skype
- Smart Home
- Software Engineering
- Sports
- SQL
- Statistics
- Survival
- TiVo
- Transportation
- Travel
- Ubuntu
- Video
- Virtualization
- Visual Studio
- VoIP
- Web
- Web Site Measurement
- Windows
- Windows Server
- Wireless
- Word
- World
- Xbox
- Yahoo!
- YouTube
Archives
Recent Posts
- Poromenos' hello world curve
- USB CapsLocker and Sun keyboard simulation
- Robosapien has a coil gun
- Faster Windows shutdown
- Assign USB drives to a folder
- Little drummer bot
- CSS ad blocking for Firefox and Safari
- Design Coding: web standards rap
- Shredz64: Guitar Hero for C64
- BATMAN: adhoc mesh routing
www.flickr.com
|





Leave a comment