posted by Tavis Ormandy on Mon 21st Feb 2005 10:53 UTC

"FVWM, Page 2/3"
The F(?) Virtual Window Manager

click for a larger view Allow me to introduce fvwm, a powerful, mature and highly configurable window manager which has been in active development for over a decade. fvwm is different, some of the features we take for granted on the command line could apply equally well to window management, and you can find many of these in fvwm.

How would I go about closing all xterms in fvwm? I'd use a command like this

All (XTerm) Close

Don't be put off by the word command, although I could enter that command directly into an FvwmConsole (an fvwm module that allows fvwm commands to be entered directly using readline), if I used the command regularly, I could make a key or mouse binding, a menu entry, a mouse gesture or one of the many other options available.
Here are some more example of how globbing might apply to fvwm; open a new web browser if there isn't one already:

None (Gecko) Exec firefox

A more complex example, Minimise the last gvim I used if my web browser is maximized:

Any (Gecko, Maximized) Prev (gvim) Iconify on


Shell functions are an important shell facility, allowing you to construct new comands from sequences of other commands. You probably use shell functions everyday in your ~/.profile to make complex command sequences easily available. Let's try an example in a standard shell

bash$ function rmoldest() {
> oldest=$1; shift
> for i in $@; do
> if test $i -ot $oldest; then
> oldest=$i
> fi
> done
> rm -f $oldest
bash$ rmoldest *.txt

A simple function to perform a task that would otherwise be very complex, delete the oldest file from a list. Let's see how this might be done in flush, which doesnt support functions or complex commands.

flush$ ls -l
-rw-r--r-- 1 taviso users 0 Feb 15 15:54 article.txt
-rw-r--r-- 1 taviso users 0 Aug 26 15:06 diagram.txt
-rw-r--r-- 1 taviso users 0 Feb 10 10:28 email.txt
-rw-r--r-- 1 taviso users 0 Nov 13 22:46 file.txt
-rw-r--r-- 1 taviso users 0 Feb 7 11:10 lists.txt
-rw-r--r-- 1 taviso users 0 Nov 4 22:43 usenet.txt
flush$ rm diagram.txt

You will manually have to check each file's timestamp, and identify the oldest one, then pass that file to rm for deletion. I doubt many of you would put up with this for long in your shell, but think about how you would close the oldest window open, or the firefox window that hadnt been in Focus for longest.

Table of contents
  1. "Flush, Page 1/3"
  2. "FVWM, Page 2/3"
  3. "FVWM, Page 3/3"
e p (0)    63 Comment(s)

Technology White Papers

See More