The Googlizer

Or...how to search Google via your Gnome panel

I am a long-term console user, but I have come to appreciate the fun of X. One of the things I love about X is that it understands networks, so that I can cheerfully start an X server on one machine and a bunch of clients on entirely different machines, and other such madness. The other thing I like is the selection. I am probably unique in this. People writing apps for X have to learn all the gruesome details and the difference between the clipboard, and the selection, and gods know what. People coming from Windows can see how to copy text, but wonder where the paste button is.

Simplifying selections for the uncoordinated

Drag and drop is hard when you have absolutely no co-ordination whatsoever. Like me. Even selecting is hard. I spent my first few days in X aiming to select and missing every damn time. It was so frustrating. People used to mice don't even notice, but when you're just starting it's awful. I got better. A bit. But highlighting long phrases would still be a pain except that there is a trick absolutely no-one seems to know about unless they have used X for years or they have read the docs.

Everyone seems to be under the impression that to select a long passage you do this:

  1. Left-click at the start.
  2. Hold the button down.
  3. Whilst holding that down, move the mouse (trackball, stylus..)
  4. Finally locate your cursor exactly right, still holding that button down with your tendon ever-aching.
  5. Finally, lift your finger up.
  6. Miss as mouse jerks away as you lift your finger. Curse. Repeat from start. Again. And again.

What a nightmare. If this does not ring a bell, you have better coordination than I have, or you have just been using X for a very long time. You can laugh at me all you want. Just you wait until you meet a stylus and wonder how on earth you're supposed to do all that now..

If, on the other hand, it rings a bell: take heart. There is an easier way.

To start a selection you left-click. To finish the selection, people seem to be under the impression they have to hold down the mouse button until they get the mouse to the right place and then lift it up. This is not so. You can do that. Or you can do this:

  1. left-click at the start. You don't need to hold the button down.
  2. move the mouse to the end
  3. right-click
  4. watch the section get highlighted

There. Isn't that easier? For the record, if you want to know the horrible programming details of all this, and the difference between such arcana as the primary selection and the clipboard, don't look here. Jamie Zawinksi has a wonderful introduction to it which will more than satisfy you if you're a trivia-hound like me.

Update To my disgust, in GNOME 2.0, this generally doesn't work. This is due to a change in the underlying library of gnome-terminal: a gnome-terminal built against zvt will probably still do it. But the default terminal widget now is vte and it doesn't seem to like this. I am unhappy about this, but there isn't a great deal I can do about it. Except whinge. And this is my web site, so whinge I shall.

But to continue to the point of this page...

Simplifying Google searches for the lazy

It seemed to me that I was spending far too long selecting text and carefully pasting it into a waiting browser pointed at Google. I wanted to be able to just find out what on earth that program or concept was, or who that author just mentioned was without having to select the words, open a browser, find Google, and paste it in. I wanted to dump the selection straight into Some App and have it all happen immediately.

So I spent about a day trying to write a shell script that I could have on my Gnome panel. Eventually I gave up, went seeking my hacker-husband, and asked for help. I explained it, he said Oooh and half an hour later he had assimilated the contents of gdk and had written the Googlizer, which did exactly what I wanted.

It is a Gnome panel launcher (not an applet, so it is not constantly running). You select some text. You left-click on the Googlizer launcher. And your preferred Gnome browser appears with the results of a Google search in it. Whee.

It is not yet shipped by default by (m)any distributors that I know of, so here is how to avail yourself of its wonders. It's very easy. And you don't even need to be root :)

Debian users, as ever, have it easy. apt-get install googlizer should work for sid as of 2002-03-25; and for woody two weeks from that. So if you're a sid or woody user, you can type that and stop reading here.

There are packages of Googlizer 2 for Slackware 9.0, too, with packages for Slackware 9.1 on their way (as of October 2003).

Note that this page talks about it as if it has no configurability at all. Originally, it didn't. These days, someone has added a bunch of stuff to it. That's version 2, effectively.

  1. Download it. It lives at ftp://ftp.linux.org.uk/pub/linux/alan/Software/Gnome/Googlizer/googlizer.tar.gz.
  2. Put it somewhere obvious. If you have somewhere for building apps already, do that. If not, a subdirectory of your home directory called Apps, or binaries, or Googlizer, or whatever will do. Or your home directory, if you're messy like me.
  3. cd into that directory if you're not already there.
  4. tar xvfz googlizer.tar.gz. The flags on this tar command are as follows:
  5. It will extract itself into a new directory: googlizer. cd into it.
  6. If you have any sense, now is when you read the contents of the README file and anything that looks human-readable :)
  7. The program itself is in C. Unlike many programs you find for Gnome, it doesn't require ./configure to be run. Just type make. You will see a line or two referring to gcc and then your prompt comes back. Looking at the directory contents again, you'll find an executable called googlizer now.
  8. If there are lots of other users on your computer who might want to use this, become root, and cp googlizer /usr/local/bin/ to put a copy where everyone can see it. If there's just you, why bother?
  9. Check you know where the program is. pwd in the directory will give you the full pathname.
  10. Right-click on your Gnome panel. Select Panel, then Add to Panel, then Launcher.
  11. In the launcher creation dialogue box, fill in the bits. I have something like It remains an application. It does not need to run in a terminal. And you can pick any icon you want for it. And obviously, put the full pathname to the app in the command, if it is not the same as what I have.

Da-dah! Now you can select any text and just left-click on the icon. And up will come Google's search results for it. Whee.

I know it sounds trivial, but it has saved me a lot of cut and paste errors, a lot of mouse-clicking and a lot of time. And I find it indispensible now.

New: a man page

I kept wanting to know how to make a man page. So when Robert McQueen packaged the googlizer for Debian and made strong hints, I finally had a go. This is my first attempt at writing a man page, so it's probably all wrong. It is not yet in the tarball with the program (unless you're a Debian user: in which case you were supposed to have stopped reading some time ago, of course). And it doesn't say anything more than what's on this page. But if you're interested, here is the googlizer man page for version 1. (As mentioned above, goolizer has morphed a bit and now includes options. Shock horror. I assume that the version 2 which I believe Debian ships has an updated man page to go with it.)

Valid HTML 4.01! Valid CSS!