Cameron Simpson's FVWM Setup
This is just a small page detailing my FVWM Window Manager setup.
My desktop is pretty spartan in appearance,
but rich in functionality:
What you see above is actually two 1280x1024 LCD displays side by side
as a single desktop using Xinerama
on a Matrox G450 dualhead video card.
The wallpaper is from Ryan Bliss'
Digital Blasphemy
wallpaper collection.
All my real work and web browsing etc takes place below the top 103 pixels of the display;
the top area is reserved for controls and status monitors.
You can see in this screen shot:
- An autohidden task bar
along the top of the screen.
It drops into view if the mouse moves over it.
- An FvwmButtons
containing an xclock,
a wmflame load meter
and, on laptops, a wmapm
power meter.
- A 6 line translucent aterm
for issuing adhoc shell commands.
It reads shell commands and runs them, and also tails my alert log.
The alert log receives important new email notifications and a very small number of other things.
- Next is an xfaces,
showing who's logged in.
- Not visible in this screenshot,
at home I would have a totally transparent small aterm
running juke,
a tiny and extremely light weight mp3/ogg jukebox program
(a 75 line shell script).
Inactive, you only see a cursor - no shading, window borders, nothing.
Active, the status display of ogg123 or mpg123.
Below these top level items are whatever windows I have open.
In this instance:
the editor window for this web page
(a full height half screen aterm with no transparency running nvi),
a transparent shell window in the directory holding this web page,
then in the four quarters of the right hand display
(clockwise from top left):
a preview of this web page in Mozilla,
a half height editor window open on my fvwmrc,
a half height transparent shell window used to take this screen snapshot,
and a half height aterm
with the fvwm manual entry in it.
I don't hold with visual clutter like
window titles,
icons for hidden windows,
cascaded or "shaded" windows,
icons for widgets (eg CDROMs etc)
and so forth.
My layout is quite disciplined:
windows are almost always quarter screen or full height half screen,
occasionally full screen (for wide log listings or poorly designed web pages).
In consequence window manipulation is very easy.
Most is keyboard driven.
Alt plus the following keys do:
- 1: move/resize window to top left quarter
- 2: move/resize window to bottom left quarter
- 3: move/resize window to top right quarter
- 4: move/resize window to bottom right quarter
- up-arrow: move/resize window to full screen
- down-arrow: move/resize window to bottom left half, full height
- shift-down-arrow: move/resize window to bottom right half, full height
- I: iconify window
- left-mouse-button: resize window
- right-mouse-button: move window
On double width Xinerama screens I add:
- 5: move/resize window to top left quarter of righthand screen
- 6: move/resize window to bottom left quarter of righthand screen
- 7: move/resize window to top right quarter of righthand screen
- 8: move/resize window to bottom right quarter of righthand screen
- 9: move/resize window to bottom left half of righthand screen, full height
- 0: move/resize window to bottom right half of righthand screen, full height
The fixed locations means I never have to fiddle with alignment or aiming.
Desktops
Since no single screen is ever big enough
I also use multiple desktops.
I have 12 numbered desktops for random stuff
(in practice I do particular things on particular desktops out of habit).
I bind Alt-Fn1 to take me to desktop 1,
Alt-Fn2 to take me to desktop 2,
an so forth.
Correspondingly,
Shift-Fn1 pushes the current window to desktop 1
from whatever desktop I'm on,
Shift-Fn2 pushes the current window to desktop 2,
and so forth.
I also keep an arbirarily large list of named desktops
for specific projects in my "Named Desktops" menu.
This is maintained by my desktop script,
which I generally call via the wrapper script "nd".
So fto go to my "FVWM" project desktop I'd just go to that shell window at the top of my screen
and type:
nd FVWM
or pull up the desktops menu with Alt-D and choose the "FVWM" entry.
A new named desktop is made on the fly if the name is new.
Correspondingly, there's a "push to desktop" menu
to push a window to a nmed desktop,
invoked by typing Alt-P over the window to be pushed.
Menus
Aside from the switch-to-desk and push-to-desk menus described above
I also have the menus described below.
Most of my menus are automaticly generated on the fly
using FVWM's DynamicPopUpAction facility
which will run an FVWM command prior to popping up a menu.
Generally that will be my "fvwm-menu" script
with suitable arguments, which tears down the current menu definition and builds a new one
with the right content, including the requirement to do this again next time the menu is popped up.
fvwm-menu in turn called a specified command to emit the menu contents.
See the AutoMenu function in my fvwmrc
and the menu definitions immediately below it.
WindowList
Instead of icons I use FVWM's built in WindowList menu,
accessed by typing Alt-L anywhere.
All the terminal have meaningful names for easy selection.
They start with good names because I open editor and shell windows
via my e or term scripts respectively,
which set good initial window names.
Shell windows keep their titles current
by rewriting the title with my ttylabel script,
called whenever I change directory.
Main Menu
Invoked by the left mouse button on the desktop root window
or from the taskbar's "start" button,
this provides broad access to most functions,
generally via a submenu.
Aside from the submenus, this does:
- Zen Mode: style the desktop as described here,
with no decorations.
- Titled Mode: style the desktop more conventionally.
Specifily, this uses titles and window borders,
and exists purely for use within a VNC desktop
where the VNC session itself is a window from FVWM's point of view
and I thus need visible handles to manipulate things.
- Restart: restart my window manager by execing the "wm" script,
which locates my preferred FVWM install in /opt
and runs it using the output of my fvwmrc script
as the config file.
This last script filters my template fvwmrc file
inserting preferred screen dimensions and colours.
These setting in turn come from the xenv.sh script,
which uses information obtained previously from the xdpyingfo command
and stashed in some environment variables
at the start of my X11 session.
The submenus include:
Screen Sessions
A list of my screen sessions,
generated from my "fvwm-menu-scr script.
Each item pops up a fresh aterm with that screen session in it.
I use screen quite heavily for long running build sessions
that I many want to monitor from elsewhere later, and also for email.
The curious may want to see my logbuild script,
which fires up a fresh ttylabelled aterm with a meaningfully named screen session inside it,
with the shell within logged to my session logs, quite handy for later reference
to how I built a particular application.
Window Lists
Various invocations of the FVWM WindowList showning
particular sets of windows
(this desktop, all desktops, so forth).
Window Ops
This starts with the usual window operations: Raise, Lower, etc.
You will notice that most entries have keyboard equivalents beside them.
This is because I've adopted the habit
of adding key bindings only via an FVWM function
with both defines the key binding
and makes an entry in a menu for it with the key description
as you see here.
See the KeyFn function in my fvwmrc.
In this way
if I forget some obscure key combination
I am guarrenteed still to be able to access it from a menu.
Image Browser
This is an autogenerated menu
that browses my personal stash of images,
used for wallpaper, menu backdrops etc.
This is not as simple as the other menus
because it make a distinct menu from each subdirectory.
To this end the function PopImDir is defined in the fvwmrc,
which takes two arguments:
a starting directory and a command to run when a particular image is actually selected.
The image browser menu just runs up "xv"
for the selected image
but there are other menus that set the root or menu backdrop from it,
and arbitrary other things could be done.
The PopImDir function defines a menu by reading from fvwm-menu
and then pops it up.
Fvwm-menu in turn calls fvwm-menu-imlist
with the directory and image selection command as arguments.
Fvwm-menu-imlist is a little complicated.
It first generates menu entries to run itself on the parent
directory and any subdirectory.
Then for each image it checks to see if there's a thumbnail present.
If there isn't, a background job is dispatched to make it
because waiting for this in a large directory
is very tedious.
Regardless,
a menu entry is made for each image
that uses the thumbnail if present.
In this way
there probably will be thumbnails on subsequent visits.
Tools Menu
Just an assortment of tools:
terminals, email, etc.
Web Menu
This contains:
- Recent Searches:
I usually invoke search engines
such as Google
or OneLook
from the command line, thus:
google funky search here
This invokes
a wrapper script
which fires up a browser window with the search in it.
It also logs the URL invoked to a file.
This menu item presents my more recent searches for reuse.
- Recent URLs:
I often show web pages from the command line too, thus:
us url-here
As above, logged and recited for reuse.
- Display URL:
I mostly invoke this via Alt-H,
bound to "pop up the URL in the cut buffer",
which I find handy for email
(I use mutt).
- Display Image URL:
fetch the URL in the cut buffer,
believing it to be an image,
and display it in XV.
Handy for comics,
some of which are rendered too small.
Maybe I need glasses.
Also handy for grabbing images,
editing with XV,
and saving somewhere.
- Google:
search for the contents of the cut buffer in google.
- Dictionary:
search for the contents of the cut buffer in onelook.
- Yahoo, DejaNews:
Pop up their front pages.
- Netscape:
fire up netscape.
Some sites just don't work with Mozilla,
usually because of self-imposed brain damage in the site author's javascript.
X11 Menu
- Recent Clip Strings:
some programs I run stash information
in the X11 cut buffer via the xclip program
for later use.
As above, logged and recited for reuse.
- Refresh Screen:
force a screen redraw.
- Load Xrdb:
reload my Xdefaults file and screen resource
with this display's settings.
Just don't ask:-(
- XKeyCaps:
handy keyboard configuration tool whose name I can never remember.
- Set Root Backdrop:
fire up the image browser
configured to set the desktop wallpaper from the specified image file
using my rootbg script.
Configuration Menu
- Reconfig:
reread the FVWM configuration.
- Set Menu Backdrop:
fire up the image browser
configured to set the menu backdrop from the specified image file
using my menubg script.
- Set Root Backdrop:
fire up the image browser
configured to set the desktop wallpaper from the specified image file
using my rootbg script.
All Menus
As with my key bindings,
I create menus via an intermediate NewMenu FVWM function.
This adds a hook to each menu to this menu-of-menus menu.
Ever get lost in a tree of menus?
This is a way out for that obscure menu you can't find.