ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RP] improvement to window selection menu


From: Robert de Forest
Subject: [RP] improvement to window selection menu
Date: Mon Nov 5 02:06:02 2001

Hello all,

I was previously announced as "Crag DeForest", which isn't quite right.
My real name (as seen below in my .signature) is Robert de Forest.  I
use the handle 'Crag' on the MOO I hang out at with SirDibos on.  He
asked someone on the MOO what my last-name was, and they didn't think to
tell him what my first name is.  And for those wondering, the Crag comes
from the original Might And Magic game my friend had on his Commodore 64
back in 80-something.

SirDibos and I developed the window selection menu together.  I came up
with the idea of piping `ratpoison -c windows` through formatting to
generate a ratmenu, and he hammered out some of the details and solved
the quoting problem.

I was looking at the NEWS.gz in CVS and noticed the new %l formatting
string which gives the last use of the corresponding window.  It occured
to me to sort on this field so that the menu behaves like an alt-tab
menu in other window managers, and then he suggested we take out the %s
(status) field.  Here's the result:

#!/usr/bin/env bash

    ( printf "ratmenu -style dreary -fg grey -bg blue";
      ratpoison -c "windows %l %n %t" | sort -nr | 
      while read l x z; do
          a=$(printf "%3q" $x)
          b="ratpoison -c \"select $x\""
          printf " %q\\ %q %q"  "$a" "$z" "$b"
      done
      echo \;
    ) | sh

SirDibos and I bound that to C-t w to replace the normal 'windows'
binding.  Simply pressing escape in ratmenu closes the list without
switching, and now that the default is the current window, enter works
too.  This is also easier to read and shows all windows, not just those
that fit along the top of the screen.

Anyway, have fun.

Robert 'Crag' de Forest

-- 
 /"\  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
 \ /   ASCII Ribbon Campaign    | Robert de Forest
  X   - NO HTML/RTF in e-mail   | System Administrator
 / \  - NO Word docs in e-mail  | Got.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]