Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

HOWTO: A Simple Fvwm Configuration

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
User avatar
Lux
Posts: 474
Joined: 2006-01-25 13:00
Location: Finland

HOWTO: A Simple Fvwm Configuration

#1 Post by Lux »

Fvwm is a versatile window manager and it's still actively developed, but unfortunately it's not very easy to configure. The configuration of fvwm has been extensively documented in the man pages but the man pages are so extensive that it's actually quite difficult to find any particular piece of information you're looking for.

Another potential problem is that the default settings of fvwm make it act differently from most other window managers. People who have used other window managers may find fvwm difficult to use because it doesn't act like they expect it to act.

I installed fvwm on Debian Lenny and played with it a bit, and I found that I didn't like the default fvwm settings. So I searched the Net to find out how other people had configured fvwm, and I picked up a lot of stuff from those config files. Then I read the fvwm FAQ and picked up a thing or two from there. I also visited the fvwm forums and picked up several things from there. As a result, I was able to write my own fvwm configuration that made fvwm act pretty much like most other window managers.

Now I want to share that fvwm configuration with others. I'm happy with my current fvwm configuration and I hope it might serve as a useful starting point for others who want to write their own fvwm configuration.

The fvwm configuration file is located in ~/.fvwm/config. It could also be called (according to the old convention) ~/.fvwm/.fvwm2rc. Both file names should work. OK, let's see what my ~/.fvwm/config looks like.

Code: Select all

## define the screen area that windows can use
## syntax: 'EwmhBaseStruts left right top bottom' in pixels
EwmhBaseStruts 0 0 0 0

## set desktops
DesktopSize 1x1
DesktopName 0 Desk 1
DesktopName 1 Desk 2
DesktopName 2 Desk 3
EdgeScroll 0 0

## ignore NumLock
IgnoreModifiers L25
The "EwmhBaseStruts" values define the desktop area that application windows are allowed to use. You can limit this area if you want to (for instance, to prevent application windows to hide some panel that you use), but in my configuration I allow windows to use the whole desktop. (This is actually the default setting, as Thomas Adam points out in his comment, but I like to keep this setting visible in the config, so I can easily change it if I want to.)

Fvwm has multiple virtual desktops that can be divided into many pages and each desktop has the same number of pages. By default, fvwm has nine pages on each desktop and the number of desktops is, according to the man page, limited to "approximately 4 billion total". The "DesktopSize" command can be used to define the number and arrangement of pages of the virtual desktops. In my configuration I set each desktop to have only one page. I also set the names for the first three virtual desktops: "Desk 1", "Desk 2", and "Desk 3".

The "EdgeScroll" defines how easily moving the mouse cursor to the edge of the screen can change the view from one desktop or page to another. In my configuration you can't change desktops by simply moving the mouse cursor.

Enabling NumLock can interfere with the fvwm keybindings; the "IgnoreModifiers" setting offers a workaround.

Code: Select all

## set desktop background colour
AddToFunc StartFunction
+ I Exec xsetroot -solid "#4E5767"


## don't show icons for minimized/iconified windows
Style "*" NoIcon


## mouse cursor styles
CursorStyle ROOT         left_ptr
CursorStyle TITLE        left_ptr
CursorStyle DEFAULT      left_ptr
CursorStyle SYS          left_ptr
CursorStyle MENU         left_ptr
There's not much need to further explain the above settings. I tell fvwm to use the xsetroot utility to draw the desktop background colour. I also tell fvwm to *not* draw any icons when I iconify/minimize windows -- in practice this will hide all the minimized windows (and they can be made visible again by using the WindowList menu). Then I tell fvwm to use similar mouse cursors everywhere (not really sure if this is actually needed).

Code: Select all

## window styles
Style * !Title
Style * BorderWidth 2, HandleWidth 2
Style * MWMFunctions, MWMDecor, HintOverride, DecorateTransient, \
   NoPPosition
Style * FPGrabFocus, FPGrabFocusTransient, FPReleaseFocus, \
   ClickToFocus
Style * SmartPlacement, WindowShadeSteps 20, ResizeOpaque
The default window decorations in fvwm are not partcularly beautiful and it's a bit too much trouble, IMO, to configure fvwm to use pixmap window decorations. Here I tell fvwm simply to *not* draw any title bars for windows. (Not sure what some of the other settings here do, or if they're actually necessary. I just picked them up from someone else's fvwm config.)

Code: Select all

## additional focus policy configuration,
## automatically give focus to new windows
DestroyModuleConfig AW-event: *

*AW-event: Cmd Function
*AW-event: add_window FuncNewWindow
DestroyFunc FuncNewWindow

AddToFunc   FuncNewWindow
+ I ThisWindow (AcceptsFocus) FlipFocus NoWarp

AddToFunc StartFunction
+ I Module FvwmEvent AW-event

## more adjustment to focus policy, 
## re-focus the last focused window when switching pages
DestroyFunc CurrentPageFocusFunc
AddToFunc CurrentPageFocusFunc 
+ "I" Next (CurrentPage, State 2) Focus
+ "I" None (CurrentPage, Focused) Prev (CurrentPage, !Iconified, \
   !Sticky) Focus

DestroyFunc MarkWindowAsActiveFunc
AddToFunc MarkWindowAsActiveFunc 
+ "I" Current (!Iconified) All (CurrentPage, !Focused) State 2 False
+ "I" Current (!Iconified) State 2 True

DestroyModuleConfig FvwmEvent: *
*FvwmEvent: Cmd Function
*FvwmEvent: new_page CurrentPageFocusFunc
*FvwmEvent: new_desk CurrentPageFocusFunc
*FvwmEvent: destroy_window CurrentPageFocusFunc
*FvwmEvent: focus_change MarkWindowAsActiveFunc

AddToFunc StartFunction
+ I Module FvwmEvent
Well, the comments should tell what these pieces of code do -- they just define how fvwm should focus application windows. I think I picked this up from the fvwm forums.

Code: Select all

# Recall that mouse formats look like this:
#
# +------------+
# | ||  ||  || |
# |            |
# +------------+
#   1   2   3

# Binding Functions
#
# "I" stands for Immediate
# "M" stands for Motion
# "C" stands for Click
# "H" stands for Hold
# "D" stands for Double Click

# -------------------------------------------------------------
# Contexts:
#     R = Root Window                 rrrrrrrrrrrrrrrrrrrrrr
#     W = Application Window          rIrrrrFSSSSSSSSSFrrrrr
#     F = Frame Corners               rrrrrrS13TTTT642Srrrrr
#     S = Frame Sides                 rIrrrrSwwwwwwwwwSrrrrr
#     T = Title Bar                   rrrrrrSwwwwwwwwwSrrrrr
#     I = Icon                        rIrrrrFSSSSSSSSSFrrrrr
#                                     rrrrrrrrrrrrrrrrrrrrrr
# Numbers are buttons: 1 3 5 7 9   0 8 6 4 2
#
# Modifiers: (A)ny, (C)ontrol, (S)hift, (M)eta, (N)othing
# -------------------------------------------------------------
The above I've stolen from Thomas Adam's config file. I found it quite helpful in setting the mouse and key bindings.

Code: Select all

## mouse bindings
Mouse 1 R A Menu Mainmenu Nop
Mouse 2 R A WindowList
Mouse 3 F A Menu MenuFvwmWindowOps Nop
Mouse 3 S A Menu MenuFvwmWindowOps Nop
Mouse 1 W M Pick move


## key bindings
Key Escape A S Popup Mainmenu Root c c
Key Tab A M WindowList Root c c NoNumInDeskTitle, \
   CurrentAtEnd, IconifiedAtEnd
Key Escape A CS WindowList Root c c NoNumInDeskTitle, \
   IconifiedAtEnd
Key Escape A C Popup MenuFvwmWindowOps Root c c
Key Q A C Close
Key N A M Maximize 100 100
Key B A M Maximize 0 100
Key G A M Maximize 100 0
Key H A M Iconify
Key M A M WindowShade Toggle

Key Right A SM PointerWindow Move w+1 w+0 Warp
Key Left A SM PointerWindow Move w-1 w+0 Warp
Key Up A SM PointerWindow Move w+0 w-1 Warp
Key Down A SM PointerWindow Move w+0 w+1 Warp
Key Right A CM PointerWindow Resize br w+1 w+0
Key Left A CM PointerWindow Resize br  w-1 w+0
Key Up A CM PointerWindow Resize br w+0 w-1
Key Down A CM PointerWindow Resize br w+0 w+2

Key F1 A 4 GotoDesk 0 0
Key F2 A 4 GotoDesk 0 1
Key F3 A 4 GotoDesk 0 2
Key Up A 4 GotoDesk -1 0 2
Key Down A 4 GotoDesk 1 0 2

Key F1 A S Exec urxvt
Key F2 A S Exec konqueror
Key F3 A S Exec icedove
Key F4 A S Exec kwrite
Key F5 A S Exec oowriter
Key F6 A S Exec lyx
Key F7 A S Exec gqview
Key F8 A S Exec gimp
Key F9 A S Exec kaffeine
Key F10 A S Exec xfe -m
Key F11 A S Exec iceweasel

Key C A CS Exec osmo -cal
Key R A CS Exec grun
Key L A CS Exec xtrlock
Those are some mouse and key bindings that I use. They should be easy to change if you're used to different bindings.

Clicking with the left mouse button on the root window (any part of the desktop that is not covered by application windows) brings up the application menu. (I would actually rather use the right button for this but using the left button overrides the default fvwm menu, which I don't much care for.) Clicking the middle mouse button on the root window will show the list of windows that are currently opened. Clicking the right mouse button while the mouse cursor is on some application window's border will show that window's "window operations" menu (that allows you to maximize/minimize/close that window or move it to another desktop).

You can move an application window if you press the Alt key while left-clicking a window. Then you can move the mouse cursor where you want to place the window and another left-click (this time without pressing Alt) will leave the window there.

You also get the main application menu if you press Shift and Escape keys at the same time. Then you can navigate the menu with the arrow keys. (Pressing Escape again will exit the menu.)

There are two key bindings to view the list of currently open application windows: Pressing Alt and Tab pops up the WindowList that allows you to switch the focus from one open window to another quickly. Pressing Control, Shift and Escape also shows the same WindowList menu that you can browse with the arrow keys, and you can hit Enter when you've decided which window you want to activate -- or you can press Escape to cancel the window switching. (This is a nice way to view what windows are currently open.) The title of the WindowList shows the current virtual desktop.

Pressing Control and Escape shows the "window operations" menu for the currently active window.

You can close the currently active window by pressing Control and the Q key at the same time. Maximize/unmaximize the active window by pressing Alt and N. Maximize the window vertically with Alt and B. Maximize horizontally with Alt and G. Minimize/hide a window with Alt and H. (You need to use the WindowList menu to bring it back again.) Press Alt and M to shade/unshade the active window.

Pressing at the same time both Shift and Alt and one of the arrow keys moves the currently active window. Pressing the Right or Left arrow key while you also press both Control and Alt should make the currently active window to either grow or shrink from its right side; pressing the Up or Down arrow key while you also press Control and Alt should either shrink or grow the currently active window from its bottom side.

My keyboard has a "MS Windows" key that has "Start" written on it and it's decorated with the MS Windows logo flag. I use this key to switch desktops. Pressing the Win key and F1 changes the view to the first desktop; Win key and F2 to the second desk; and Win key and F3 to the third desk. Pressing the Win key and Up or Down arrow key is an alternative way to switch desktops via key bindings. Also, pressing Shift and F1-F11 starts some applications that I use often.

Code: Select all

## menu styles
Colorset 00 fg white, bg #69768B
Colorset 01 fg #FFFFC4, bg #697871
Colorset 02 fg #C0C0C0, bg #8D97AF

MenuStyle * Hilight3DThin, Animation, PopupOffset 0 100
MenuStyle * Font "xft:Liberation Sans:style=Regular:pixelsize=16"
MenuStyle * TitleFont "xft:Liberation Sans:style=Bold:pixelsize=16"
MenuStyle * MenuColorset 00, ActiveColorset 01, HilightBack
MenuStyle * BorderWidth 1, TitleUnderlines1, SeparatorsLong
MenuStyle * TrianglesSolid, ItemFormat "%.2|%.5i%.5l%.5i%2.3>%2|"
Notice: The colours can look wildly different with different display hardware and different Xorg configuration. On my display the above settings look decently nice but on your computer the same colour settings may look like crap. You should also set the menu font according to your own preference -- here I use Liberation fonts that are not currently packaged for Debian.

Code: Select all

Read /etc/X11/fvwm/menudefs.hook

## main menu
DestroyMenu "Mainmenu"
AddToMenu "Mainmenu" "Main Menu" Title
+ "XTerm" Exec exec xterm
+ "Links 2" Exec exec links2 -g
+ "Krusader" Exec exec krusader
+ "Crack Attack!" Exec exec crack-attack
+ "" Nop
+ "Debian Menu" Popup /Debian
+ "" Nop
+ "Identify" Pick Module FvwmIdent
+ "" Nop
+ "Restart Fvwm" Restart
+ "Quit Fvwm" Quit
+ "" Nop
+ "Reboot" Exec exec sudo /sbin/reboot
+ "Halt" Exec exec sudo /sbin/halt


## window operations menu
DestroyMenu MenuFvwmWindowOps
AddToMenu MenuFvwmWindowOps
+   "Move To Desk"      Popup MenuDeskList
+   ""  Nop
+   "Shade/Unshade"     Pick WindowShade Toggle
+   "Iconify"           Pick Iconify
+   "Maximize"          Pick Maximize
+   ""  Nop
+   "Raise/Lower"       Pick RaiseLower
+   "Stick/Unstick"     Pick Stick
+   ""  Nop
+   "Identify"          Pick Module FvwmIdent
+   ""  Nop
+   "Close"             Pick Close
+   "Destroy"           Pick Destroy


## move to desk menu
DestroyMenu MenuDeskList
AddToMenu MenuDeskList
+ " Desk 1" Pick MoveToDesk 0 0
+ " Desk 2" Pick MoveToDesk 0 1
+ " Desk 3" Pick MoveToDesk 0 2
You need to have the "menu" package installed before you can use the "Debian Menu" submenu to start applications.

Notice that I've enabled the nopasswd execution of /sbin/reboot and /sbin/halt for my normal user in /etc/sudoers (via the "visudo" command), so I can reboot or halt the computer from fvwm's main menu. The above configurations are the actual menus that I currently use -- you might want to edit them to suit your personal needs and preferences.

Code: Select all

## start some applications maximized
DestroyModuleConfig FE-StartMaximized: *
*FE-StartMaximized: Cmd Function
*FE-StartMaximized: add_window FuncStartMaximized

AddToFunc StartFunction
+ I Module FvwmEvent FE-StartMaximized

DestroyFunc FuncStartMaximized
AddToFunc   FuncStartMaximized
+ I ThisWindow ("URxvt") Maximize
+ I ThisWindow ("XTerm") Maximize
+ I ThisWindow ("Konqueror") Maximize
+ I ThisWindow ("Links") Maximize
+ I ThisWindow ("Pysol") Maximize
+ I ThisWindow ("GQview") Maximize
+ I ThisWindow ("Lyx") Maximize


## styles for some applications
Style "conky"     !Handles, Sticky, WindowListSkip, CirculateSkip
Style "Clock"     !Handles, Sticky, CirculateSkip, BorderWidth 0
Here I tell fvwm to start some applications maximized and define how fvwm should show conky and rclock. I use rclock, that comes with rxvt, as an analog desktop clock. I allow it to show in the WindowList menu, so I can easily raise it when I want to check the time. In ~/.xinitrc I've set the rclock background colour to be the same as the desktop background colour (the geometry values are suitable for my 1024x768 screen):

Code: Select all

rclock -update 2 -nodate -bg '#4E5767' -fg white -geometry 150x150+750+65 &
Then I use the "BorderWidth 0" fvwm style option to hide the rclock borders, so rclock looks transparent against the desktop background. 8)

* * * * * *

Next, I want to add some bloat to my otherwise relatively light-weight fvwm setup. ;)

I configure a panel using the in-built "FvwmButtons" utility. I set it to show a pager (the in-built FvwmPager) plus some dockapps. Then I set a key binding that raises or lowers the panel whenever I press the Win key and D simultaneously. This way I can easily view the panel and then hide it again while I'm using some applications that cover the whole screen area.

Code: Select all

## configure a panel that shows pager and dockapps
DestroyModuleConfig FvwmPager: *
*FvwmPager: Colorset * 02
*FvwmPager: HilightColorset * 01
*FvwmPager: Rows 3
*FvwmPager: Columns 1
*FvwmPager: MiniIcons
*FvwmPagerFont "xft:Liberation Sans:style=Bold:pixelsize=12"

Style "MyDock"    !Handles, Sticky, WindowListSkip

DestroyModuleConfig MyDock: *
*MyDock: Colorset * 02
*MyDock: ButtonGeometry   64x64-0+0
*MyDock: Columns          1
*MyDock: Back             #808080
*MyDock: Frame            1
*MyDock: (1x3, Swallow "FvwmPager" 'FvwmPager 0 2')
*MyDock: (Swallow (NoClose, UseOld) "wmCalClock" 'Exec wmCalClock -24')
*MyDock: (Swallow (NoClose, UseOld) "wmbiff" 'Exec wmbiff')
*MyDock: (Swallow (NoClose, UseOld) "wmweather" 'Exec wmweather -s EFTP -m')
*MyDock: (Swallow (NoClose, UseOld) "mixer_app" 'Exec Mixer.app')
*MyDock: (Swallow (NoClose, UseOld) "wmmount" 'Exec `wmmount -- -s`')

AddToFunc StartFunction
+ I Module FvwmButtons MyDock


## key binding to raise and lower the MyDock panel
DestroyFunc  MyDockFunc
AddToFunc    MyDockFunc
+ I Next (MyDock, Layer 6) Layer
+ I TestRc (NoMatch) Next (MyDock) Layer 0 6

Key D A 4   MyDockFunc
That's all, folks! :)


Here's what my fvwm setup looks like in action:

Image

If you need help in configuring fvwm, you should go straight to the FVWM Forums.

For some RTFM, see first the FVWM FAQ. The FVWM Beginners Guide is another helpful resource for configuring fvwm. The man pages that come with fvwm offer very detailed information about the available fvwm configuration options but they're also very long and very technical.

Your experiences and opinions of fvwm are welcome in this thread. Fvwm configuration tips are also most welcome.


Edit 2008-04-15:
Made fvwm to set the desktop background colour by calling xsetroot directly instead of starting the FvwmBacker module. This saves a small amount of RAM. Also cleaned up the Mainmenu syntax a bit.

Edit 2008-04-16:
Added bold font to menu titles. I also decided that I want the WindowList title to show what the current desktop is, so WindowList can function as a primitive desktop pager if one doesn't want to load the panel. I figured that I need to change the "one desk, three pages" model that I used in my original fvwm config to "three desks, each having only one page" model. This required rewriting several bits of my original fvwm config (DesktopSize, key bindings, "move to page" menu, FvwmPager settings...). I also updated the screenshot because FvwmPager now shows labels for the three available desktops.

Edit 2008-04-29:
Added key bindings to move and resize application windows. Also made fvwm to read the global "menu.hooks" file, so the Debian menu gets updated automatically.

Edit 2008-04-30:
Changed the key binding to move application windows (from Alt+arrow_key to Shift+Alt+arrow_key) because popular Internet browsers, like iceweasel and konqueror, use Alt+left_arrow_key to switch to the previously visited page, and the window manager specific bindings override the application specific bindings.

Edit 2008-05-01:
Made some minor corrections at Thomas Adam's request.
Last edited by Lux on 2008-05-01 11:06, edited 7 times in total.
"Hit the philistines three times over the head with the Elisp reference manual."
-- Michael A. Petonic --

User avatar
garrincha
Posts: 2335
Joined: 2006-06-02 16:38

#2 Post by garrincha »

Quite detailed HOWTO on FVWM!:)

Though I would suggest that for a complete beginner not to start from a blank canvass as it would be too long and complex for him/her unless you're prepared to dive into the world of coding. It's better to start with a theme pack and use its configuration, learn about it before attempting creating one's own theme.

The 'beginner guide' in your post above has a downloadable theme and you can follow along with the guide in that case.

For a more ambitious among you, have a look at some theme packs:
http://www.as.ua.edu/~flux/fvwm/
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."

User avatar
Lux
Posts: 474
Joined: 2006-01-25 13:00
Location: Finland

#3 Post by Lux »

I agree that the ready-made theme packs are a good way for beginners to view what fvwm can be made to do, particularly if you like eye-candy. Some of those themes look very nice indeed.

The downside is that adding eye-candy can quickly make fvwm a resource hog. Then again, that doesn't matter much if you've got a new and fast computer with lots of RAM. My fvwm configuration aims to be simple and keep fvwm light-weight, especially if you don't need the panel that I added in the end of my fvwm config.

For those who are always hungry for some extra eye-candy, check out these fvwm patches. They're unofficial and aren't included in the Debian fvwm package, so you need to compile fvwm from source to be able to use them. Adding a patch to source code is easy -- just uncompress the fvwm source tarball, go to the source directory, download the patch file there, and use a command like "patch -p0 < patch_file" (where the "patch_file" part should be the name of the patch file you downloaded).
"Hit the philistines three times over the head with the Elisp reference manual."
-- Michael A. Petonic --

User avatar
Lux
Posts: 474
Joined: 2006-01-25 13:00
Location: Finland

#4 Post by Lux »

The official Debian package of fvwm has been built with some features that I don't really need. So I built my local version of fvwm from source and disabled the support for GNOME and perl. This made the resulting fvwm binary considerably less resource-hungry. (I could confirm this with the "htop" program.) Here's a step-by-step guide to installing fvwm from source in Debian. I still have also the official Debian package of fvwm installed because it includes the automatically updated Debian menu for starting applications.

At the time of writing this tutorial, the latest version of fvwm is 2.5.25 (yes, the fvwm developers recommend people to use their "unstable" release), and so I use this version in the following command examples. When newer versions of fvwm are released, readers of this tutorial should apply the changes to the example commands accordingly.

1. "su" to root and install the essential compiling tools.

Code: Select all

$ su
# apt-get install build-essential
2. Install the build dependencies for the fvwm source package.

Code: Select all

# apt-get build-dep fvwm
The above command installs many packages if you haven't built any applications from source in your Debian system before. Those packages are only needed for building fvwm, they are not needed for running it. So those packages can be safely removed after you've compiled your local version of fvwm. The list of installed packages can be viewed afterwards in /var/log/dpkg.log.

After installing the build dependencies, become a normal user again.

Code: Select all

# exit
3. Create a temporary directory for compiling fvwm and go into that directory.

Code: Select all

$ mkdir -p ~/tmp/fvwm
$ cd ~/tmp/fvwm
4. Download the latest unstable release of fvwm from http://fvwm.org/download/

Code: Select all

$ wget -c ftp://ftp.fvwm.org/pub/fvwm/version-2/fvwm-2.5.25.tar.bz2
5. Uncompress the fvwm tarball and go into the source directory.

Code: Select all

$ tar -xjf fvwm-2.5.25.tar.bz2
$ cd fvwm-2.5.25
6. (Optional.) Check what configuration options are supported.

Code: Select all

$ less INSTALL.fvwm
$ ./configure --help
7. Configure fvwm with your preferred options. Here are the options I use.

Code: Select all

$ ./configure --prefix=/usr/local/fvwm --disable-mandoc --disable-sm --disable-xinerama --disable-bidi --disable-perllib --disable-rsvg --disable-gtk --disable-gtktest --disable-imlibtest --without-gnome --without-rplay-library --without-stroke-library --disable-nls --without-readline-library --without-imlib-library
The "--prefix" tells where you want fvwm to be installed. I use a directory under /usr/local, so my local version of fvwm can be easily uninstalled by simply removing that directory. "mandoc" stands for man pages, "sm" for session management support, "xinerama" for multiple monitors support, "bidi" for bi-directional text support, "perllib" for perl support, "rsvg" for svg image support, and then there're some GMOME support options, "rplay" stands for system-events sound support, "stroke" for mouse strokes support, and "nls" for translated messages support. I don't need any of those features (and the fvwm messages are translated only to a handful of languages anyway).

And here are some more options for those who like to make their local version of fvwm even more light-weight.

Code: Select all

--without-png-library --without-xpm-library --disable-shape --disable-shm --disable-xrender --disable-xcursor --disable-xft --disable-iconv
"png" and "xpm" support enable icons in menus. (They might be needed also for pixmap tilebars in app windows -- but my own fvwm config disables titlebars.) "xrender" and "xcursor" are needed to show different shapes of mouse cursors, for example in resizing app windows with mouse. "xft" adds support for antialiased fonts and "iconv" adds support for different font encodings, which I need to show the Finnish Debian menu properly in fvwm.

After the configuration has been done, the configuration script shows a summary of the chosen options. If you're not happy with this summary, you can run "make distclean" and then run the configure command again with different options.

8. Build fvwm.

Code: Select all

$ make
9. "su" to root, install fvwm, and become a normal user again.

Code: Select all

$ su
# make install
# exit
10. Clean up.

Code: Select all

$ cd
$ rm -rf ~/tmp/fvwm/*
$ rmdir ~/tmp/fvwm
11. Make your .xinitrc point to /usr/local/fvwm (in case you start Xsessions from the command line with "startx").

Code: Select all

$ nano ~/.xinitrc
Make the last line look like this:

Code: Select all

exec /usr/local/fvwm/bin/fvwm
Then exit the editor, saving changes.

12. Use "startx" to start the local fvwm version you just installed. Easy as pie, wasn't it? :)
"Hit the philistines three times over the head with the Elisp reference manual."
-- Michael A. Petonic --

Lou
Posts: 1739
Joined: 2006-05-08 02:15

#5 Post by Lou »

Nice howto, thumbs up!
Devuan Jessie - IceWM - vimperator - no DM
KISS - Keep It Simple, Stupid

ThomasAdam
Posts: 4
Joined: 2008-04-30 22:21

Re: HOWTO: A Simple Fvwm Configuration

#6 Post by ThomasAdam »

Thanks for this post, but I have several points to make, and several clarifications you yourself have raised....
Lux wrote: I also visited the official fvwm forums and picked up several things from there.
They're not "official" in the sense that they're endorsed by fvwm.org -- it just happens to be a larger volume of FVWM-related information than the mailing list.
Lux wrote:
The fvwm configuration file is located in ~/.fvwm/config. It could also be called (according to the old convention) ~/.fvwm/.fvwm2rc. Both file names should work. OK, let's see what my ~/.fvwm/config looks like.
See: http://fvwmwiki.bu-web.de/GeneralConfigGuideLines
Lux wrote:

Code: Select all

## define the screen area that windows can use
## syntax: 'EwmhBaseStruts left right top bottom' in pixels
EwmhBaseStruts 0 0 0 0
The "EwmhBaseStruts" values define the desktop area that application windows are allowed to use. You can limit this area if you want to (for instance, to prevent application windows to hide some panel that you use), but in my configuration I allow windows to use the whole desktop.
It's set to this by default.
Lux wrote:
The "DesktopSize" value defines how the FvwmPager shows your virtual desktops and their pages (in case you want to use the in-built FvwmPager). It also defines how you can set the key bindings and menu items to switch between virtual desktops and pages.
No it doesn't. And you're mixing a few things in there which aren't related (the bit about switching to virtual desks from bindings).

DesktopSize just defines how the **pages** are arranged *conceptually* in a given desk. For example, if one has:

Code: Select all

DesktopSize 2x2
Then I have a grid which looks like a square. Now by default, FvwmPager will attempt to adjust itself to however you've set DesktopSize. But it needn't stay that way, I could if I wanted to define settings in FvwmPager:

Code: Select all

*FvwmPager:  Columns x
*FvwmPAger:  Rows y
Which would alter how the pages are arranged in the pager considerably - and could affect navigation depending on how you decided to switch pages.
Lux wrote:
Fvwm can have multiple multiple desktops that can be divided into many pages. In my configuration I set up three virtual desktops and I call them "Desk 1", "Desk 2", and "Desk 3". Each desktop has only one page and they are ordered into a vertical row (the second desktop is below the first and the third desktop is below the second).
This comment is only valid if you've messed with the Row/Column settings to FvwmPager. By setting DesktopName, you are defining explicit Desks which you can reference in certain commands (Style commands for instance). Again, as with the ordering, that's dependent on how you navigate around.
Lux wrote:

Code: Select all

## set desktop background colour
AddToFunc StartFunction
+ I Exec xsetroot -solid "#4E5767"
See FvwmBacker to set per page/desk colours.
Lux wrote: Then I tell fvwm to use similar mouse cursors everywhere (not really sure if this is actually needed).
No, it's not needed if you use xsetroot to set the pointer also.
Lux wrote:

Code: Select all

## window styles
Style * NoTitle
Can we have: !Title, please?

Lux wrote: The default window decorations in fvwm are not partcularly beautiful and it's a bit too much trouble, IMO, to configure fvwm to use pixmap window decorations.
The decor stuff can be a little cumbersome, but it's not *hard* to use Pixmaps on titlebars -- *that* part of decor is explained well enough with examples in the FVWM manpage.

Lux wrote: Here I tell fvwm simply to *not* draw any title bars for windows. (Not sure what some of the other settings here do, or if they're actually necessary. I just picked them up from someone else's fvwm config.)
I wrote these for someone on the FvwmForums.

See: http://fvwm.lair.be/viewtopic.php?t=414

I'll detail its operation here for you.

Code: Select all

## additional focus policy configuration,
## automatically give focus to new windows
DestroyModuleConfig AW-event: *
Destroys the previous event called AW-event.

Code: Select all

*AW-event: Cmd Function
Tells FvwmEvent that the action to run for each defined action is a function.

Code: Select all

*AW-event: add_window FuncNewWindow
Actually tells FvwmEvent that we're wanting to listen for new windows mapped to the screen and that when they are, we wish to run a function called FuncNewWindow.

That function looks like this:

Code: Select all

DestroyFunc FuncNewWindow
AddToFunc   FuncNewWindow
+ I ThisWindow (AcceptsFocus) FlipFocus NoWarp
Where if the window accepts focus, that focus is given to it.

Code: Select all

AddToFunc StartFunction
+ I Module FvwmEvent AW-event
This kick-starts it up at init/restarts.

The whole point of this masquerade is for one thing: the pointer never moves when focusing windows -- otherwise I could have used:

Code: Select all

Style * GrabFocus
Just as well. I could even have used:

Code: Select all

Style * GrabFocus, !FPFocusByFunctionWarpPointer
But this isn't sufficient still, alas.
Lux wrote: Well, the comments should tell what these pieces of code do -- they just define how fvwm should focus application windows. I think I picked this up from the official fvwm forums.
Again, note the use of "official" here.
Lux wrote:

Code: Select all

DestroyFunc  MyDockFunc
AddToFunc    MyDockFunc
+ I Next (MyDock, Layer 6) Layer
+ I TestRc (NoMatch) Next (MyDock) Layer 0 6
This has to be one of the most requested functions I've ever written.

-- Thomas Adam

User avatar
Lux
Posts: 474
Joined: 2006-01-25 13:00
Location: Finland

#7 Post by Lux »

ThomasAdam wrote:They're not "official" in the sense that they're endorsed by fvwm.org
Fixed.
ThomasAdam wrote:you're mixing a few things in there which aren't related (the bit about switching to virtual desks from bindings).

DesktopSize just defines how the **pages** are arranged *conceptually* in a given desk.
Fixed.
ThomasAdam wrote:Can we have: !Title, please?
Wish granted.

Thanks for the clarifications.
"Hit the philistines three times over the head with the Elisp reference manual."
-- Michael A. Petonic --

Post Reply