You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

Aaaaaaaaand - Cut!

So, the clipboard. Exciting, eh? You probably use it all the time. Cut this, copy that, paste the other. Ideally, you should be able to copy text, images, or anything you like from any application and to drop them into the same
application or any other application. It avoids the need to mess around with saving a temporary file, and sometimes it's the only way to do the job.

The problem is, the clipboard in Linux doesn't always do what you expect. Shouting at the computer doesn't fix the problem (I've tried!) so it might be useful to delve a little deeper and find out what's happening behind the scenes.

The first thing to know is: There are TWO clipboards. One belongs to X-windows, the other belongs to Gnome. (Actually that's not entirely true, but it's close enough) Try this:

Open two terminals and run 'nano' in each (nano is the basic text editor).

In the first terminal, type two different lines of text.

Select the first line with the mouse, then select Edit->Copy from the menu.

Select the second line with the mouse, and just leave it highlighted

Now in the second window select Edit->Paste, and the first line should be pasted

Now click the middle mouse button in that window, and the second line should appear.

(if you only have two mouse buttons, press both at once for a middle-click)

(For added fun, Nano also has an internal clipboard, accessed with Ctrl+K and Ctrl+U, that only works within the single editor session.)

So the X-windows clipboard, traditionally accessed by selecting text to copy it and middle-clicking to paste it, works with any application and only supports plain text. The Gnome clipboard does not work with some older apps but is able to cope with things such as rich text and images. For example, try opening a website in Firefox and selecting some formatted text and images, then select Edit->Copy. If you paste that into OpenOffice you'll see the format and images are preserved. If you paste it into Nano it gets converted to plain text. If you paste into GIMP Image Editor you get an error. Most of the time this works the way you expect, but keeping in mind the way the computer is having to convert your clipboard data can make things less baffling when unexpected things happen.

Three other useful things to do with the clipboard are to retrieve a history of contents, copy between the two clipboards, and force rich content on the clipboard to plain text. A clipboard manager will do this, and there are several - take a look here:

The standard one for Gnome is Glipper. Install the 'glipper' package via Synaptic, then right-click your top panel and 'Add to Panel'. Select 'Clipboard manager' and a little icon should appear. Copy a few things to the clipboard and then left-click the icon to see the list. Selecting any of these will drop it into BOTH clipboard buffers, but converted to plain text in both cases.

I use Glipper and find it indispensible, but it does have some glitches. For instance, copying images between applications can stop working with Glipper in effect. This bug has been around for a while and you can follow the progress here: https://bugs.launchpad.net/ubuntu/+s...er/+bug/104432. Hopefully a fix is on the cards, but right now the only remedy is to
temporarily disable Glipper - not ideal.

That's quite enough clipboard internals, I think. Next time, the Evolution mail program and how to make it do what you want.