[1+1=2]

OneAndOneIs2

« My settings, everywhereCommunication »

Mon, Jan 23, 2012

[Icon][Icon]Yaks

• Post categories: Omni, Rant, My Life, Programming

At work, we frequently refer to yaks.

It's a term we picked up from the Perl community. I imagine it's used by other hacker communities as well, but I wouldn't know.

The story goes:

You wake up one morning and think to yourself, "I should mow the lawn this morning!"

Then you realise that you can't, because you don't have a mower: You lent it to your neighbour.

You figure you'll go and get it back from your neighbour, but then remember that you borrowed the neighbour's air compressor at the same time. You'll need to return the compressor if you want to get back your mower.

But the reason you haven't returned the compressor is that the hose ruptured whilst you were using it and you need to fix it before you can return it.

So you'll have to go to a hardware store to get a new hose. But you don't have a car, so you'd need somebody to give you a lift.

Your other neighbour would normally be willing to give you a lift, but he lent you a garden chair a while ago and he'd want that back before he did anything for you. And you haven't returned the chair because the cushion in it ripped and some of the stuffing came out.

So you need to fix the chair first. The chair is stuffed with yak hair. As luck would have it, you have a friend working at the local zoo, which is within walking distance. So you nip down to the zoo, have a word with your friend, and then head off into the yak enclosure.

An hour after you woke up and decided to mow the lawn, and you're at the zoo, shaving a yak. To a casual onlooker, a completely unrelated task; yet at the same time a vital prerequisite.

In programming circles, if somebody says they're shaving a yak, it means they're doing something that's vital if they want to get their main task done, but which doesn't actually get them anywhere towards accomplishing their task. In the same way that shaving a yak doesn't get the lawn mown.

Lately, it seems like a relatively simple goal has been encountering, not so much a succession of yaks, but an entire herd of them.

Here's the problem: Linux doesn't have a single GUI. It has a lot of them. From the simple & lightweight "window managers" to the heavy-hitting windows-like "desktop environments".

The one I've used for many years has been showing its age lately, and with the announcement being made that it was going into maintainence mode, I figured it was probably time to find something new.

Problem is.. I have a very specific setup. The functionality that I want is not the default for anything out there. And part of the reason I stuck with FVWM2 for so long is that nothing else is actually capable of doing what I want.

But I was confident that I could overcome that if I stuck with it. So I started shopping around for a good configurable, light-weight desktop.

Enlightenment is very shiny, but it's not nearly EWMH-compatible enough: A script I use to toggle a window between monitors doesn't work, for example.

I'm currently trying Openbox, but this has two big problems: When I toggle the mouse between monitors, the window it moves to only gets focus about half the time - this intermittent behaviour is infuriating; and there's no detectable way of enabling "warp to window" so when you use alt-tab to switch to a window, your mouse doesn't get moved to that window. Which is stupid. It means, for instance, that if I alt-tab to Firefox, I can't then use my scroll wheel because the mouse pointer is still over an xterm.

Fluxbox has possibilities, but also problems - its menus don't seem to work just by typing a letter, you have to press "return" to make something happen. This is annoying. And there's a weird bug going on where every time I toggle a window between monitors, it resizes it.

In my bid to get all the functionality that I need, I've gone from having a couple of shell scripts to having a rather large Perl program which is gaining more & more features as I try & get everything working the way I want.

It's actually reached the point where somebody at work mentioned that the X11 books by O'Reilly actually contain enough code that you can write your own bare-bones Window manager, and I'm seriously considering it on the grounds that if no other WM will do what I want, maybe my only choice is to roll my own.

But I'm going to have a go at creating a simple Tcl/Tk interface that'll call everything I need via Perl first. Because obviously, that's far easier.

Sigh.

Yaks! Yaks everywhere!!

7 comments

Vincent Povirk
Comment from: Vincent Povirk [Visitor] Email
Why can't you fix FVWM, or one of those other WM's you mentioned? Surely that's easier than writing your own.
24/01/12 @ 02:50
pdh
Comment from: pdh [Visitor]
Sounds like somebody doesn't have enough to do at work :p
24/01/12 @ 08:13
oneandoneis2
Comment from: oneandoneis2 [Member] · http://geekblog.oneandoneis2.org/
@Vincent - Because it's easier to hack a small codebase of your own than it is to get to grips with an existing, massive project.

Academic at the moment anyway - I've installed the latest version of FVWM2 and hopefully it won't suffer the bugs the older version I was using had.
24/01/12 @ 11:45
Vincent Povirk
Comment from: Vincent Povirk [Visitor]
I actually have some thoughts on that. I built a window manager (Lucca WM, google it if you care) in college using GTK, and came to the conclusion that I (and nearly everyone else who has ever built a window manager) had done it wrong.

I structured my window manager in two layers, the "core" layer and the "xwm" layer. The idea was that xwm would take care of all the details of the X protocol, ICCCM, EWMH, and the various hacks that any WM unfortunately needs to work well with some broken programs and libraries, while the "core" layer would handle the policy: when to reparent, when to focus, when to move things to where. The "core" part of the program didn't even link Xlib; it simply used gtk and xwm. That was a good idea, but I did it wrong.

First of all, I made xwm a source library instead of a shared library. That meant that it could only ever be used from a C program. If I had made it a shared library (and if gobject introspection had existed at the time), it could've been usable from any programming language supporting gobject introspection, not just C. (As it is now, most window managers are not only implemented in pure C, they're implemented in pure X11, with no toolkit. While it's certainly possible to use a toolkit, and I did it, it's not easy.)

But that's a minor problem, easily addressed. The real problem is with what happens when you use xwm in the most trivial way possible, firing it up and then doing nothing but let it run.

What actually happens is that you get a broken desktop. It's worse than no window manager, because the WM will intercept the requests from applications to map their windows, and completely ignore them. There's some minimal amount of code you need to make a usable WM, and a user writing a new WM would typically start by copying an existing one. That's bad.

What should happen is that you get a fully ICCCM- and EWMH-compliant window manager with the simplest possible policies. So when xwm gets a map request, it should (if the program using it does not handle the request) simply map the window. When it sees a dock, it should (if not told otherwise) dock that window and subtract the appropriate area from the work area, which it reports to all other X11 programs in accordance with the EWMH standard. When it gets a request from a pager to focus a window, it should (unless told otherwise) simply focus the window. When someone clicks a window, the click should go directly to the window because no policy was set that says it should be intercepting clicks.

I like to call this hypothetical window manager "nullwm". In nullwm, all your programs work, but it doesn't give you a way to focus, move, resize, minimize, maximize, or close them. If you have another EWMH-compliant program running that gives you a way to do those things, it'll work. This would be a real test program, that I would actually build, were I actually writing a WM library.

I like to think that starting from nullwm (which is a nearly empty codebase) would be easier than starting from scratch, which you seem to think is the easiest method. If you don't care about how docks work, you can completely ignore them and let the library handle it for you, notifying you when the resulting work area changes. You could focus on the policies you actually care about. It'll need some good documentation of course, but I don't think getting there would be very difficult.

Unfortunately, this would require a redesign and rewrite of xwm, and I never bothered to do it. To be worthwhile, I would need at least one potential user other than me. So I guess what I'm getting at is if you do ever decide to write your own WM (and I still think you probably shouldn't), let me know and maybe we can collaborate.
24/01/12 @ 16:55
Richard Oliver
Comment from: Richard Oliver [Visitor] Email
It was your blog that actually inspired me to look into lightweight window managers. I had been using Fluxbox for a while but have since moved to awesome (a tiling window manager). I thought that the move would be difficult but I managed to pick it up in a couple of hours. As for the problem you mention moving the mouse between monitors, the default key mappings for awesome take care of pretty much any way in which you would wish to manipulate windows. It's also nice to be able to use 100% screen space all the time. Also, using chromium/firefox vim extension plugins and the apvlv pdf viewer, I have found that I no longer really need to use my mouse at all! Also, a point that's worth mentioning is that it can utilise gnome applets as well, such as volume control or network-manager plugin if that's your kind of thing.

Anyway, point is... you should check it out if you get the time.

Richard
26/01/12 @ 00:58
xdg
Comment from: xdg [Visitor] · http://www.dagolden.com/
I've recently switched to XMonad and after a bit of learning curve, I've been very happy with its minimalism and ability to customize behavior. Admittedly, I've had to learn some Haskell.
16/02/12 @ 20:25
oneandoneis2
Comment from: oneandoneis2 [Member] · http://geekblog.oneandoneis2.org/
and Haskell is on my list of languages to learn when I have time. I'm reading through http://learnyouahaskell.com in my rare spare time..
17/02/12 @ 08:45

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)
 

[Links][icon] My links

[Icon][Icon] Hmm.. new look for twitter? I hope it gets less "Ick! Change! Put it back!" nonsense than Facebook..
08/02/12

[Icon][Icon] Facebook Syndication Error
22/02/12

[Icon][Icon] I last listened to:
Johann Pachelbel - Canon in D major

[Icon][Icon] Most recent photo:
Submersible houseboat

[Icon][Icon]About Me

[Icon][Icon]About this blog

[Icon][Icon]My LQ profile

[Icon][Icon]My /. profile

[Icon][Icon]My Wishlist

[Icon]MyCommerce

[FSF Associate Member]


February 2012
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29        

Search

User tools

XML Feeds

eXTReMe Tracker

Valid XHTML 1.0 Transitional

Valid CSS!

[Valid RSS feed]

powered by b2evolution free blog software