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

Linux.com

Feature

Customizing FVWM even more

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

Share    Print    Comments   

In my last article on FVWM, the F Virtual Windows Manager, I wrote about its basic setup, how to create a task bar, and how to create your own menus. In this article I'll be looking at further ways of customizing the windows manager to improve the basic desktop.

We already looked at how to build customized menus, but before we move on let's have a look at the ones that come built in to FVWM. As before, all code should be placed in the file ~/.fvwm/.fvwm2rc (or one of the files that it can call using the Piperead command).

FVWM comes with some built in KDE menus for people who want a lighter desktop, but want easy access to some of KDE's elements. To access them, use FVWM's fvwm-menu-desktop module to create the KDE User and System menus:

AddToMenu kde-user
+ DynamicPopupAction PipeRead 'fvwm-menu-desktop --desktop kde-user'
AddToMenu kde-sys
+ DynamicPopupAction PipeRead 'fvwm-menu-desktop --desktop kde-sys'

Then add these new menus into the main structure:

AddToMenu Main Main Title
+ "KDE User Menu" Popup kde-user
+ "KDE System Menu" Popup kde-sys
+ "Restart%mini-turn.xpm%" Restart
+ "Exit%mini-exclam.xpm%" Quit

Using the GNOME Menus

FVWM also has some GNOME menus that you can make use of. However, they are handled slightly differently from the KDE menus:

Module FvwmGtk
*FvwmGtkMenu gnome-all
*FvwmGtkSubmenu "System" gnome-sys
*FvwmGtkSubmenu "User" gnome-user

PipeRead 'fvwm-menu-desktop --type gtk --enable-mini-icons'

PipeRead 'fvwm-menu-desktop --type gtk --desktop gnome-user --enable-mini-icons'

AddToMenu Main Main Title
+ "Gnome Menu" SendToModule FvwmGtk  gnome-all
+ "Restart%mini-turn.xpm%" Restart
+ "Exit%mini-exclam.xpm%" Quit

Using multiple desktops

So far we've worked with only one desktop, but you can actually have as many as you want by using FVWM's FvwmPager, a utility that lets you move from one desktop to another.

First you need to tell FVWM which style FvwmPager should use. For example, to create FvwmPager without a title or a border, and to make sure that it is displayed on every desktop, use:

Style "FvwmPager" NoTitle, !Handles,  Sticky

Next, tell FvwmPager to display icons on desktops where we have applications running, and then to show a "balloon" that contains the name of the application when we place the mouse over the icon.

*FvwmPager: MiniIcons
*FvwmPager: Balloons All
*FvwmPager: BalloonColorset 0

You can also tell FvwmPager how many columns and rows to display. To display the desktops in a grid use:

*FvwmPager: Rows 3
*FvwmPager: Columns 3

If you want you can move the pager to somewhere other than the top left corner of the screen:

A note about window geometries

The window geometry statement can look confusing if you are not used to it, but the format is really simple. It consists of four elements: width, height, x offset, and y offset. Width and height are obvious enough -- Geometry 100x50 will define a window 100 pixels wide by 50 high.

The x offset can be defined as either positive (setting the number of pixels the window lies from the left of the screen) or as negative (pixels from the right of the screen). Similarly, the y offset defines the number of pixels from the top of the screen (a positive number) or from the bottom of the screen (a negative number).

Examples are:

  • 100x50+100+100: 100 wide by 50 high, 100 from the left, 100 from the top;
  • +0-50: default size, 50 pixels from the bottom of the screen.
*FvwmPager: Geometry 100+0-100

Finally tell FVWM to display FvwmPager. You also need to tell FVWM the range of desktops. For example, to show three desktops use:

Module FvwmPager 0 2

You may want to use the Pager to move from screen to screen through each virtual desktop set (instead of moving the mouse cursor to the edge of the screen). If so, then set EdgeResistance, which controls how long you must hold your mouse close to the edge of the screen in order to change screens, to a high value:

EdgeResistance 100000 0

Now that you can move easily between the desktops you can further personalize them by giving them individual background colours. Although they look different, each of the following will work (the first two are older formats, the third is technically the correct one):

*FvwmBackerDesk 0 -solid yellow
*FvwmBacker: Desk 1 -solid yellow
*FvwmBacker: Command (Desk 2) -solid white

The changes will not be implemented until you instruct FVWM to update the screens during the initialization and the restart operations:

AddToFunc RestartFunction I Module FvwmBacker
AddToFunc InitFunction I Module FvwmBacker

Instead of colours you can define background images:

*FvwmBacker: Command (Desk 0) Exec xpmroot ~/images/dave-bowman-mono.xpm
*FvwmBacker: Command (Desk 1) Exec xpmroot ~/images/seven-at-moria-gates.xpm
*FvwmBacker: Command (Desk 2) Exec xpmroot ~/images/RigelVII-Holberg917G_fortress.xpm

You can even set each desktop screen (or page) with a different background:

*FvwmBacker: Command (Desk 2, Page 0 0) -solid midnightblue
*FvwmBacker: Command (Desk 2, Page 0 1) -solid magenta
*FvwmBacker: Command (Desk 2, Page 0 2) -solid white
*FvwmBacker: Command (Desk 2, Page 1 2) -solid skyblue

The FVWM button box

The last area we'll look at is FvwmButtons -- FVWM's Button Box -- a window that sits on the desktop and acts as a container for buttons or for active applications such as xload and xclock.

As always, set the look and feel first:

Style "FvwmButtons"     NoTitle,BorderWidth 0,HandleWidth 0,Sticky
*FvwmButtons: Back white
*FvwmButtons: Frame       1
*FvwmButtons: Geometry    500x64-0
*FvwmButtons: Rows        5
*FvwmButtons: Columns     64

Now we can do some of the interesting stuff. First we'll add the active applications, which these will be displayed within the button box, but will be live.

*FvwmButtons: (6x5, Swallow "FvwmXclock" `Exec xclock -name FvwmXclock -geometry 40x40+0-3000 -padding 1 -analog -chime -bg white`)
*FvwmButtons: (20x5, Padding 0, Swallow "xload" `Exec xload`)

We can also add "normal" buttons -- ones that you click to start the applications:

*FvwmButtons: (6x5,Title Firefox, Icon /opt/firefox/icons/mozicon50.xpm, Action `Exec "Firefox" firefox &`)
*FvwmButtons: (6x5,Title Thunderbird, Icon /opt/thunderbird/icons/mozicon50.xpm, Action `Exec "Thunderbird" thunderbird &`)

FVWMButtons must (just like the other modules we've looked at) be called from FVWM in order to work:

AddToFunc RestartFunction I Module FvwmButtons
AddToFunc InitFunctionI Module FvwmButtons

Using these techniques you can see that FVWM can produce a desktop that is light, fast, attractive, and above all does exactly what you need it to.

Share    Print    Comments   

Comments

on Customizing FVWM even more

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

fvwm usability

Posted by: Anonymous Coward on August 31, 2005 08:13 PM
I have used fvwm as my main window manager for about 2 years. I think that fvwm is one of the most powerful window managers around, BUT -
It has one major drawback - Its scripting language which is VERY hard to learn and use. It takes a lot of time and effort until you make fvwm behave and look just the way you want. And yes, I have used fvwm-themes for a while, and I have used Suzzane Skinner's window decorations for a while, etc...

But still - why not make fvwm configurable with a well known language - for example lua , or python , or any other language which is well known and/or easy to learn

#

Re:fvwm usability

Posted by: Anonymous Coward on September 01, 2005 10:01 PM
> Its scripting language which is VERY hard to learn and use.

I guess you mean "configuration language", there are only very basic elements of scripting, and they are all pretty easy to learn.

> why not make fvwm configurable with a well known language - for example lua, or python, or any other language which is well known and/or easy to learn

Does a general purpose language have the concepts of desks, pages, windows, decorations, focus, menus, icons, modules, button bars, window styles, hints and commands? I am not sure you understand what you complain about. You need a configuration language that works with all these concepts.

If you know perl, then there are several ways to integrate it with your fvwm configuration. For example, write a separate script producing a configuration (in any language), write a separate short- or long-living module that interacts with fvwm (C or Perl), or use an embedded syntax (FvwmPerl).

#

relief joint

Posted by: Anonymous Coward on May 30, 2006 01:06 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]

#

shaped icons

Posted by: Anonymous Coward on September 01, 2005 02:18 PM
One of the interesting uses for FvwmButtons is to make shaped icons.

You use a transparent<nobr> <wbr></nobr>.xpm image, and put it in a single-panel FvwmButton of its own, with no borders, titlebar etc. What you get is a shaped image floating on your desktop. You give it different bindings to allow you to click it as a launcher or drag it around.

I agree with previous comment that the configuration language is not so hot. It is really not a proper programming language, even though fvwm is a scriptable window manager and deserves a proper scripting language.

Other things I don't like about fvwm - the unpronouncable name, and the default theme (although this has improved since earlier versions). The name we are stuck with, but the default theme! Fvwm can do amazing things with eye-candy - why not flaunt it?

Other than that, an excellent window manager, and well worth a 2nd, 3rd and forth look.

#

Article corrections

Posted by: Anonymous Coward on September 01, 2005 09:49 PM
Please use correct syntax for modules documented in the man pages, i.e. "*FvwmGtk: ", "*FvwmBacker: " prefixes.

Please start modules in StartFunction, do not duplicate them in InitFunction and RestartFunction.

#

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



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya