This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature

Customizing FVWM

By on August 08, 2005 (8:00:00 AM)

Share    Print    Comments   

FVWM, the F Virtual Windows Manager, is a window manager for computers running the X Window System. While KDE and GNOME offer more features, they are also heavy on memory usage. FVWM is light and fast, and you can customize it to meet your needs, and apply these customizations throughout your organization.

The default FVWM screen is very basic -- just a simple blue desktop. Clicking anywhere with the left mouse button brings up a menu with a couple of built-in options, including xterm. You can also move around the virtual desktop by moving mouse cursor off the edge of the screen (you'll find there are nine 'screens' in a 3x3 grid). And there you have it -- simple, light, and very fast.

You want more? Let's put in some window control.

Basic FVWM customization

FVWM uses the file ~/.fvwm/.fvwm2rc to override its default configuration. Create this file with the following contents:

Mouse 0 1 A Iconify
Mouse 0 2 A Maximize 100 100

Style "*" NoIcon
EdgeResistance 1000 0

Style "FvwmTaskBar" NoTitle,BorderWidth 0,HandleWidth 0,Sticky
AddToFunc InitFunction I Module FvwmTaskBar
AddToFunc RestartFunction I Module FvwmTaskBar

In this file, the first two lines create a maximize and minimize button for all windows. The next line switches off the icons for minimised applications. Put a hash mark at the start of the line if you want to see what the icons look like; personally, I think they clutter up the screen too much. The EdgeResistance setting slows down the changing from one screen to another. A value of 1000 means 1 second; i.e. you must hold the mouse cursor at the edge of the screen for one second before the screen will switch. If you want only one screen then put this value very high (e.g. 100000). Finally, the last three lines create a task bar at the bottom of the screen.

In order to see your changes you must restart FVWM. Left-click on the main screen, then select Restart FVWM.

Once the screen has refreshed itself you should see a task bar at the bottom of the screen, complete with a Start button. It has no functionality at the moment, but we can add some by adding the following to the file:

AddToMenu "Internet" "Internet" Title
+ "Firefox%mini-x.xpm%" Exec firefox &
+ "Thunderbird%mini-x.xpm%" Exec thunderbird &

AddToMenu "Main" "Main" Title
+ "xterm%mini-x.xpm%" Exec xterm &
+ "Internet%mini-x2.xpm%" Popup Internet
+ "Restart%mini-turn.xpm%" Restart
+ "Quit%mini-exclam.xpm%" Quit

*FvwmTaskBarStartMenu Main

This code includes a Main menu containing xterm, a sub-menu for Internet applications, the restart function, and an Exit button. If you now restart FVWM then you will find that the Start button has this new popup menu associated with it. You can build up your own set of menus to run the applications that you need.

In addition to the Start menu we can also customize the default Builtin Menu that's accessible by clicking the left mouse anywhere on the main screen. We can also add some functionality to the right mouse button, which does nothing at the moment. Add the following code to ~/.fvwm/.fvwm2rc:

Mouse 1 R A Menu Main
Mouse 3 R A Menu Internet

A left mouse click will now invoke the Main function instead of the Builtin Menu, whilst the right one will show the Internet menu. In this way you can build up a Windows Manager that has all of the applications that you require.

Interacting with the shell

So for we have only looked at static menus -- that is, those that are hard-coded into the file. However, you can also build dynamic menus based on shell commands. To do this use the Piperead command:

AddToMenu ListFiles ListFiles Title
Piperead `for f in ~/*.html; do echo "+ $f Exec gedit $f"; done`

This simple example builds a menu listing all of the HTML files in your home directory, and allows you to access them using gedit.

Using FVWM within an organization

We've seen how FVWM allows you to have all your key applications at your fingertips. Once you've done that for one system, you can easily deploy your changes across an organization. You can set up .fvwm2rc files according to a person's function with the organization -- a developer doesn't need to see the same menus as his manager. The manager doesn't need to see the same things as her directors. The directors just need to see the things that will keep them happy.

This can be addressed in a few ways. The most obvious way would be to copy the customized .fvwm2rc file into each person's .fvwm directory according to what they need to see. This works well, but if you make any changes to the main .fvwm2rc files, you've then got the headache of remembering who has which file, and then rolling it out to them.

A better way is to create a link from the user's .fvwm directory to a central file:

ln -s /etc/FVWM/.fvwm2rc_user .fvwm2rc

However, the best approach is to make use of Piperead, the Linux groups command, and the FVWM Read function. The Read command lets you include a second config file. Each user's .fvwm2rc needs to contain only the following line:

Piperead "echo Read /etc/FVWM/.fvwm2rc_$(groups|awk '{print $1}')"

The .fvwm2rc file will look up a user's group and load the appropriate file. This, of course, assumes that you have created the directory /etc/FVWM and that it contains a set of files called .fvwm2rc_users, .fvwm2rc_root and so on -- one for each group.

In this article we've looked only at FVWM's most basic functionality. We've not looked at fonts, colours, FVWM's buttons, or dynamic menus. The FVWM Web site presents an excellent section (under Screenshots) with a vast array of configurations that may give you some inspiration. If you try some, before long you will have a professional, well-designed window manager you can use throughout your organization.

Share    Print    Comments   

Comments

on Customizing FVWM

Note: Comments are owned by the poster. We are not responsible for their content.

FVWM-Crystal

Posted by: Anonymous Coward on August 09, 2005 12:31 AM
You can also try the excellent FVWM-Crystal Theme/Mod at <a href="http://fvwm-crystal.berlios.de/" title="berlios.de">http://fvwm-crystal.berlios.de/</a berlios.de>.

#

Eliminate the Mouse with "CursorMove"

Posted by: Anonymous Coward on August 09, 2005 01:55 AM
The absolute best feature of FVWM, IMHO, is the "CursorMove" directive.

With this, you can bind keystrokes to warp your pointer in any direction by a given percentage.

What this means, basically, is that you can have "Ctrl-Up", for example, move the cursor (pointer, mouse, what-have-you) upward by a small amount. When combined with Focus Follows Mouse (or "SloppyFocus") this means you can select different windows without ever having to take your fingers off the keyboard -- never again will you have to reach for that infernal rodent!!!

My ".fvwm2rc" contains the following:


  Key h A MC CursorMove -10 0

  Key h A MS CursorMove -1 0

  Key l A MC CursorMove 10 0

  Key l A MS CursorMove 1 0

  Key k A MC CursorMove 0 -10

  Key k A MS CursorMove 0 -1

  Key j A MC CursorMove 0 10

  Key j A MS CursorMove 0 1

Which maps "Meta + Control + {'vi' key}" to move my mouse by 10% of the screen, and "Meta + Shift + {'vi' key} to move by 1%. This is extremely effective for switching to different windows, and saves me a *TON* of time.

I also use:


  Key h A M UnfocusScroll -100 +0

  Key l A M UnfocusScroll +100 +0

  Key k A M UnfocusScroll +0 -100

  Key j A M UnfocusScroll +0 +100

To make "Meta + {'vi' key}" move an entire page / workspace / desktop / whatever.

If you hate having to reach for the mouse, FVWM makes it *VERY* convenient to get work done from the keyboard.

Hope that helps!

#

relief joint

Posted by: Anonymous Coward on May 30, 2006 01:14 AM
[URL=http://nervepainrelief.jeeran.com/painrelief<nobr>.<wbr></nobr> htm] Nerve pain relief [/URL]

  [URL=http://www.back.painreliefnetwork.net/lowbac<nobr>k<wbr></nobr> pain.htm] Low back pain [/URL]

  [URL=http://blog.gala.net/uploads/painreliefback/<nobr>b<wbr></nobr> ackpainrelief.htm] Back pain relief [/URL]

  [URL=http://www.weblog.ro/usercontent/13155/profi<nobr>l<wbr></nobr> es/kneepainrelief.htm] Knee pain relief [/URL]

  [URL=http://www.info.painreliefnetwork.net/Pain-R<nobr>e<wbr></nobr> lief.html] Pain relief [/URL]

  [URL=http://www.sitefights.com/community/scifi/pa<nobr>i<wbr></nobr> nrelief/painreliefpreved.htm] Pain relief [/URL]

  [URL=http://www.info.painreliefnetwork.net/Medica<nobr>t<wbr></nobr> ion-Pain-Relief.html] Medication pain relief [/URL]

  [URL=http://www.info.painreliefnetwork.net/Natura<nobr>l<wbr></nobr> -Pain-Relief.html] Natural pain relief [/URL]


  [URL=http://painrelief.fanspace.com/index.htm] Pain relief [/URL]

  [URL=http://lowerbackpain.0pi.com/backpain.htm] Back Pain [/URL]

  [URL=http://painreliefproduct.guildspace.com] Pain relief [/URL]
[URL=http://painreliefmedic.friendpages.com] Pain relief [/URL]

#

I'm having a big problem with FVWM.

Posted by: Anonymous Coward on August 09, 2005 02:44 AM
It seems that certain apps (like Citrix ICA client) tell the WM they want to go borderless (i.e., "full screen").

Kwin has no problem with this, but FVWM will give the ICA session a window frame whether it asks or not.

Is this one of those standards to which FVWM does not adhere?

#

Re:I'm having a big problem with FVWM.

Posted by: Anonymous Coward on August 09, 2005 06:17 AM
Not at all. The problem is to do with the hints an application will specify to the WM about the state of the window, before it is mapped.

These full-screen applications are almost always EWMH-aware. FVWM aderes to this as best it can. The fullscreen problem is one of the application, usually, and not of FVWM. Workarounds from within FVWM exist, and searching the fvwm forums: <a href="http://fvwm.lair.be/" title="fvwm.lair.be">http://fvwm.lair.be/</a fvwm.lair.be> will prove most useful.

-- Thomas Adam

#

Thank you very much.

Posted by: Anonymous Coward on August 09, 2005 10:09 AM
Thanks for the pointer. Let me see, in "General Configuration Questions":

"The fact that it is a window with EWMH hints is irrelevant -- please, search the forums for FvwmEvent and maximize -- I've mentioned how to do this for window countless times.


  -- Thomas Adam"


LOL!

You know, Thomas, it's nice people like you who make me believe Linux is more than just an OS...

I'm the client, not the developer. I see now there's a way to remove the undesired border, which is important in a organization setting (you know, PHBs against Linux etc.). I can now bug the developer. 8-D

The things we do to get Linux into the enterprise...<nobr> <wbr></nobr>:-/

Live long and prosper!

#

Re:I'm having a big problem with FVWM.

Posted by: Anonymous Coward on August 12, 2005 09:26 AM
In FVWM you can specify that certain applications have their own frame style. It is straightforward to tell a given client to go borderless, based on the application name amongst other possibilities.

#

Re:I'm having a big problem with FVWM.

Posted by: Anonymous Coward on August 13, 2005 02:58 AM
Yes, but this still fails to address some of the problems EWMH apps have, in going fullscreen. It's much more than simply making the window borderless.

#

Looks

Posted by: Anonymous Coward on August 10, 2005 12:13 AM
These XP-styled themes looks pretty cool.
- <a href="http://fvwm-themes.sourceforge.net/screenshots/full/ice.jpg" title="sourceforge.net">http://fvwm-themes.sourceforge.net/screenshots/fu<nobr>l<wbr></nobr> l/ice.jpg</a sourceforge.net>
- <a href="http://fvwm-themes.sourceforge.net/screenshots/full/redmondxp.jpg" title="sourceforge.net">http://fvwm-themes.sourceforge.net/screenshots/fu<nobr>l<wbr></nobr> l/redmondxp.jpg</a sourceforge.net>

It possible make Windows 98 look too.
- <a href="http://fvwm-themes.sourceforge.net/screenshots/full/redmond98.png" title="sourceforge.net">http://fvwm-themes.sourceforge.net/screenshots/fu<nobr>l<wbr></nobr> l/redmond98.png</a sourceforge.net>

There used to be this project called Fvwm95, but I dont think that it is still alive. It seemed quite cool.

But for those who want Windows XP look in Linux, there is the WM "xpde".
- <a href="http://www.xpde.com/shots.php" title="xpde.com">http://www.xpde.com/shots.php</a xpde.com>

But my favourite light-weight WM is Fluxbox.

#

localization

Posted by: Anonymous Coward on August 11, 2005 07:24 PM
This WM don't support utf8 !
Do somebody know reason to use it in international environment ?

#

Re:localization

Posted by: Anonymous Coward on August 12, 2005 09:28 AM
b/c it rocks? TFA barely touched the surface of what FVWM is really capable of.

#

Re:localization

Posted by: Anonymous Coward on August 15, 2005 10:10 PM
If it's not working on your system, it could be that the pre-compiled package you are using doesn't have it turned on. Or some other configuration error exists.

#

relief joint

Posted by: Anonymous Coward on May 30, 2006 01:26 AM
[URL=http://nervepainrelief.jeeran.com/painrelief<nobr>.<wbr></nobr> htm] Nerve pain relief [/URL]
[URL=http://www.back.painreliefnetwork.net/lowbac<nobr>k<wbr></nobr> pain.htm] Low back pain [/URL]
[URL=http://blog.gala.net/uploads/painreliefback/<nobr>b<wbr></nobr> ackpainrelief.htm] Back pain relief [/URL]
[URL=http://www.weblog.ro/usercontent/13155/profi<nobr>l<wbr></nobr> es/kneepainrelief.htm] Knee pain relief [/URL]
[URL=http://www.info.painreliefnetwork.net/Pain-R<nobr>e<wbr></nobr> lief.html] Pain relief [/URL]
[URL=http://www.sitefights.com/community/scifi/pa<nobr>i<wbr></nobr> nrelief/painreliefpreved.htm] Pain relief [/URL]
[URL=http://www.info.painreliefnetwork.net/Medica<nobr>t<wbr></nobr> ion-Pain-Relief.html] Medication pain relief [/URL]
[URL=http://www.info.painreliefnetwork.net/Natura<nobr>l<wbr></nobr> -Pain-Relief.html] Natural pain relief [/URL]


[URL=http://painrelief.fanspace.com/index.htm] Pain relief [/URL]
[URL=http://lowerbackpain.0pi.com/backpain.htm] Back Pain [/URL]
[URL=http://painreliefproduct.guildspace.com] Pain relief [/URL]
[URL=http://painreliefmedic.friendpages.com] Pain relief [/URL]

#

KDE and GNOME are not window managers

Posted by: Anonymous Coward on August 23, 2005 07:02 PM
KDE and GNOME are desktop environment that do *include* a window manager. So to say that FVWM offers *fewer* features is unfair.
(As a FVWM-only user I suspect that FVWM has *more* features than the KDE and GNOME WMs.)

#

Menu and iconify

Posted by: Anonymous [ip: 85.28.87.86] on August 08, 2007 09:16 PM
To define action of either left of right click, we do for example:

Mouse 0 1 A Iconify
Mouse 0 2 A Maximize 100 100

and add the TaskBar:

Style "FvwmTaskBar" NoTitle,BorderWidth 0,HandleWidth 0,Sticky
AddToFunc InitFunction I Module FvwmTaskBar
AddToFunc RestartFunction I Module FvwmTaskBar

Something odd I noticed is that a right-click on an icon in the TaskBar does not (des)iconify but left-click does.
I have fvwm on Debian Etch.

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya