Wednesday, November 02, 2005

Improving the Linux GUI

Slashdot has yet another "What Linux must do to beat Windows" story running. Yawn. My own take, as most people probably know by now, is that Linux isn't trying to beat Windows and people really need to take that on board before they make these kind of posts.

However, a couple of the suggestions he made about improving the UI reminded me of what I'd like to see improved in Xorg's X11. And it's not one I've seen addressed anywhere else.

It's the clipboard.

Copy & paste in Linux is different from Windows. It's not Ctrl-C Ctrl-V (although many apps do support that these days). Instead, when you highlight something with the mouse, it's copied. Then you middle-click with the mouse, and it pastes.

It's actually much better than Windows in many ways, although it does get on your nerves occasionally when you go to paste some text and realize that you have to manually delete the current text because you can't highlight it without loosing your current copy.

It's also flawed by it's limitations: You can't, for instance, copy an image in Firefox, and then paste it into Gimp. You have to save it to disk and then open it.

Lastly, unlike the "traditional" C&P functionality in Linux, such as vi's, there's only one buffer to copy to. Sometimes, you want more than that.

So here's how I'd like copying & pasting to work on Linux:

You highlight the stuff you want to copy, be it text, images, files, or whatever. If that's all you do, it copies into buffer 0. However, if you press any of the number keys, from 1 to 9, before releasing the mouse button, then the highlighted material is copied into a different paste buffer.

You go to where you want to paste. Middle-click as usual if you want to paste from buffer 0. If you want any of the others, 1-9, then once again, you press the number before releasing the mouse button.

This simple modification allows for the same behaviour as currently exists, if that's all you want; but also means you can keep multiple things in the buffer. This means that if you come to paste somewhere but need to highlight something first, you don't loose what you currently have copied: Just put the new text into a different buffer.

An example:

I want to C&P a URL from an Xterm into Firefox. Currently, I would have to: Switch from the Xterm to Firefox. Clear the current URL. Go back to Xterm, highlight URL. Go back to FF. Middle-click

But with my idea: Highlight URL in Xterm. Switch to Firefox. Highlight current URL, press '1', release mouse. Press delete. Middle-click.

Nice & easy, you no longer have to clear the way before a C&P.

The next thing that would be different would probably call for existing apps to be modified: Make the clipboards ubiquitous and improve the 'intelligence' of them. The end goal allowing for behaviour along the lines of:

In a browser, you have a web page with text and images. You highlight part of the page, with both images and text in the selection.

  • A middle-click in OpenOffice pastes text and images, as you'd expect.

  • A middle-click in Gimp brings up a "Paste menu". Inside this menu, you have each of the images you highlighted that you can paste, either as a new image or as a new item. You also have the option of pasting the text in a text box inside an image, and of pasting the whole text-and-graphic string into an image, so it will look exactly like it would in OOo or FF.

  • A middle-click in an Xterm only pastes the text.

  • A middle-click in Vi with a .txt file open only pastes the text.

  • A middle-click in Vi with a .htm file open pastes the text, and also inserts HTML pointing to the images, so when the HTML is published, you can see the images.

And so on. The basic tenet being, you should always be able to paste everything that the application is capable of supporting.

With multiple clipboard buffers and a universal and configurable C&P, the Linux GUI would be a much better place, IMHO.


Post a Comment

<< Home