In praise of xlogo [entries|reading|network|archive]
simont

[ userinfo | dreamwidth userinfo ]
[ archive | journal archive ]

Mon 2019-02-18 13:39
In praise of xlogo

For those who haven't encountered it before, xlogo is a trivial X11 application that pops up a window showing the X Window System logo.

It's close to being the X equivalent of a ‘hello, world’ program, which makes it a good lightweight initial test case. Whenever I need to do a quick check of my X11 connectivity (which in my case usually means I'm checking that SSH X forwarding is basically alive), xlogo is a good choice of program to run: it won't spend ages setting itself up, and unlike text-only alternatives like xdpyinfo, it'll pop up a window on the target display, which makes it easy to check that my connection has gone to the right display.

But that's not all xlogo is good for. There are several other things I use it for:

As a specification. The source code of xlogo is the official location of the definition of the X logo. On one occasion I wanted to put the X logo into some kind of document (though I now can't remember what), and it turned out that the right way to do that was to read the xlogo source and hand-translate the drawing code into SVG.

As a ruler. Want to know how big something on your screen is in pixels? Fire up an xlogo, line it up with one edge of the thing, resize until the opposite edge lines up too, and if your window manager puts up a tooltip during window resizing (which I think all the ones I've ever used do), then you know the size.

As an alarm clock. One of my favourite ways to get a computer to notify me when a job has finished is to get it to start up a giant xlogo large enough to obscure most of my screen – when it's done. This is better than an audible alert because it's less antisocial in an open-plan office; it's better than a momentary window flash because if you happen to be looking away at the time the xlogo is still there when you look back; and it's better than something like echo Done because there's no risk of the window with the message in it being behind something at the time.

As a colour chart. Want to quickly check what #012345 looks like, or one of those X-specific colour names like SteelBlue or OliveDrab? I don't know of a faster way than xlogo -bg 'whatever'.

I've also heard of people using it as an X session lifetime process that is, the thing which, when it goes away, causes the rest of your X session to shut down. I don't do that one myself, and I think it's not common these days because desktop environments generally come with something specifically designed to play that role; but it still has some advantages, because xlogo is so simple that it's very unlikely to crash by accident, whereas if your session lifetime process is doing almost any kind of real work, it's more likely to run into fatal trouble.

In short, I find it a much more useful program than you might think! The only thing I've always found a bit annoying about it is that pressing ‘q’ doesn't close it – I've always had to go hunting for the close button. But I've just found out that that's configurable, so now I can do

echo "XLogo*translations: :<Key>q: quit()" | xrdb -merge

and now my xlogos are easily dismissible, as I've always wanted. Hooray!

LinkReply
[personal profile] mtbcMon 2019-02-18 13:49

I've been known to use xmessage for notifications and xclock or xload to hang my session off.

Link Reply to this | Thread
[personal profile] damerellMon 2019-02-18 23:59

I've always used xclock for that - I think it might have been that way on CUS?

Link Reply to this | Parent
[personal profile] simontThu 2019-02-28 11:58

The only thing I've always found a bit annoying about it is that pressing ‘q’ doesn't close it

... now fixed upstream, hooray!

Link Reply to this
navigation
[ go | Previous Entry | Next Entry ]
[ add | to Memories ]