You're viewing a single post. I have much more to say! The main blog page is a good starting point.
Tuesday, May 23, 2006 ★ 00:44 ★ Categories Gnome, Programming
A few days ago I stumbled upon a question in a newsgroup: how to put text on the Gnome clipboard from the command line?
In response, I wrote a small Python script (using PyGTK) that can be used as a pipe in your command line scripts. It puts all data from stdin on the clipboard. For this to work, you will need the correct $DISPLAY environment variable set (which will be the case most of the time, but it doesn’t work from cron for example).
CLI lovers, download copy-to-clipboard here and rejoice!
Update: Sure, there’s also tons of other solutions like xclip and of course the script could be more like a one-liner, but I like to demonstrate the ease of use Python and PyGTK offer.
Random photo from Gouda (December, 2008)
Wouter Bolsterlee, also known as uws, a postmodern geek living in the Netherlands. Read more about me…
Unless stated otherwise, all material on this site is available under a Creative Commons Share-Alike license.