Free Republic
Browse · Search
General/Chat
Topics · Post Article

Skip to comments.

Customizing FVWM
Linux.com ^ | 2005-08-08 | Mark Alexander Bain

Posted on 08/08/2005 4:54:43 PM PDT by N3WBI3

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.


TOPICS: Computers/Internet
KEYWORDS: fvwm; linux; opensource; unix
FVWM is about my all time favorite WM, even though now I use xmmf I usually start out people new to linux with FVWM95

The only thing that disapoint me about this article is that it does not go into fvwm2 with its gui configuration options but it does have great comments about other things that can be done.

1 posted on 08/08/2005 4:54:44 PM PDT by N3WBI3
[ Post Reply | Private Reply | View Replies]

To: N3WBI3; ShadowAce; Tribune7; frogjerk; Salo; LTCJ; Calvinist_Dark_Lord; Buck W.; clyde asbury; ...

OSS PING

If you are interested in a new OSS ping list please mail me

2 posted on 08/08/2005 4:55:36 PM PDT by N3WBI3 (If SCO wants to go fishing they should buy a permit and find a lake like the rest of us..)
[ Post Reply | Private Reply | To 1 | View Replies]

To: N3WBI3

As much as a fan of Linux as I am (I'm posting on linux), it just does not seem like this article belongs in News and Activism.


3 posted on 08/08/2005 5:01:09 PM PDT by konaice
[ Post Reply | Private Reply | To 1 | View Replies]

To: N3WBI3
one problem... It's ugly as hell.

I'll stick with kde, and run it on a computer powerful enough to handle real graphics.

4 posted on 08/08/2005 5:04:14 PM PDT by xcamel (Deep Red, stuck in a "bleu" state.)
[ Post Reply | Private Reply | To 2 | View Replies]

To: konaice
oops sorry I was in the wrong place, meant to be in computers.. Mea culpa..
5 posted on 08/08/2005 5:04:15 PM PDT by N3WBI3 (If SCO wants to go fishing they should buy a permit and find a lake like the rest of us..)
[ Post Reply | Private Reply | To 3 | View Replies]

To: xcamel
the graphic I posted is not the current kde, thats from 1996 nobody uses FVWM95 any more and when they do its spruced up with better colors and fonts..

I like KDE but its a fat-fat WM. Ever since they started to become the feature king (by competing with gnome) they have gotten into bloat issues..

Oh well one of the nice things about Linux is a selection of WM's

6 posted on 08/08/2005 5:05:57 PM PDT by N3WBI3 (If SCO wants to go fishing they should buy a permit and find a lake like the rest of us..)
[ Post Reply | Private Reply | To 4 | View Replies]

To: xcamel

Ditto.


7 posted on 08/08/2005 11:55:54 PM PDT by xmm0 (This post has been brought to you by the letters "U," "S," and "A" and Amendment number 1.)
[ Post Reply | Private Reply | To 4 | View Replies]

To: xcamel
Yes, it's quite ugly.

But it's lightweight.

If you're recovering a P200 laptop with 32MB of RAM to be used for very light comm duties, FVWM isn't a bad choice.

That said, it wouldn't be my choice. I've got a terminal server that can have displays exported across dial-up + VPN. I needed a lightweight front end. I looked at both FVWM and TWM and felt that both of them would be too different for Windows users to figure out quickly.

I settled on XFCE.

Lightweight, fast, low overhead, and quite usable.

8 posted on 08/09/2005 1:50:11 AM PDT by Knitebane (Happily Microsoft free since 1999.)
[ Post Reply | Private Reply | To 4 | View Replies]

To: Knitebane; N3WBI3
I settled on XFCE.

I have been running Fluxbox for serveal weeks now and love its lightening-quick startup time. I'd gotten so used to KDE taking forever to startup after login, that I keep forgetting that fluxbox typically takes less then 5 secs to start up.

I installed xfce last night (via yum), and played around with it. I like it's combination of quickness and features, it's quick, and it's seems to be quite useful. It's got a very good chance of becoming my deafult WM.

9 posted on 08/09/2005 5:52:31 AM PDT by ShadowAce (Linux -- The Ultimate Windows Service Pack)
[ Post Reply | Private Reply | To 8 | View Replies]

To: ShadowAce
Xfce is nice and if need be runs the Gnome panel quite nicely. There are some good native widgets out there as well.
10 posted on 08/09/2005 6:04:32 AM PDT by N3WBI3 (If SCO wants to go fishing they should buy a permit and find a lake like the rest of us..)
[ Post Reply | Private Reply | To 9 | View Replies]

To: ShadowAce
What I'd really like to see is a Live CD with XFCE as the default desktop.

My only real complaint with Live CDs is how slow they load up. A lightweight desktop should make that a bit better.

11 posted on 08/09/2005 6:19:24 AM PDT by Knitebane (Happily Microsoft free since 1999.)
[ Post Reply | Private Reply | To 9 | View Replies]

To: Knitebane
My only real complaint with Live CDs is how slow they load up. A lightweight desktop should make that a bit better.

Agreed. DSL uses fluxbox as its default WM, and it's not too bad. In fact, the entire distro can be run on a RAM disk.

12 posted on 08/09/2005 6:26:59 AM PDT by ShadowAce (Linux -- The Ultimate Windows Service Pack)
[ Post Reply | Private Reply | To 11 | View Replies]

Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.

Free Republic
Browse · Search
General/Chat
Topics · Post Article

FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson