Peter Blair

FVWM : My window manager at work

It’s about time that I posted my config file for my window manager, for a number of reasons, one of which is as a backup should my machine crash out.

I’m a big fan of FVWM, because it allows me to tinker with my desktop environment until my fingers become so adept at moving around my environment that I no longer have to think when navigating all of my screens/windows/etc.

Hey, scroll to the bottom, as there’s more writing there…

############################ General Configuration ############################
 
ImagePath /usr/local/share/pixmaps
 
DeskTopSize      3x3
DesktopName      0 Desktop
OpaqueMoveSize   1
SnapAttraction   5 All Screen
 
#EdgeScroll       100000 100000
EdgeScroll       0 0
EdgeResistance   0 0
EdgeThickness    1
 
PipeRead 'fvwm-theme -init'
PipeRead 'fvwm-desktop -init'
PipeRead 'ctunez -init /music'
 
################################## Functions ##################################
ModulePath /usr/lib/fvwm/2.5.18/:/usr/lib/fvwm/2.5.24:/home/pblair/.fvwm/modules
 
AddToFunc InitFunction
   + I Exec xsetroot -solid black
   + I Exec xbindkeys
   + I GotoPage 1 1
   + I Exec xscreensaver
   + I Exec nohup /home/pblair/bin/watch-email.sh
   #+ I Exec xcompmgr -cCfF -r7  -l-10 -t-8 -D7  -O 0.020
 
AddToFunc StartFunction
   + I FvwmButtons
#   + I Module FvwmPeteTransFocus
 
AddToFunc FvwmXterm
   + I Exec xterm
 
AddToFunc GrowMax
   + I Maximize growonlayers $[w.layer] -1 grow grow
 
AddToFunc Max
   + I Maximize layer grow grow
 
AddToFunc VertMax
   + I Maximize layer 0 grow
 
AddToFunc HorMax
   + I Maximize layer grow 0
 
AddToFunc SemiMax
   + I Move 136p 0
   + I Maximize growright growdown
 
AddToFunc RaiseAndFocus
   + I Focus
   + I Raise
 
AddToFunc RaiseAndFlipFocus
   + I FlipFocus
   + I Raise
 
AddToFunc WindowLeftClick
   + I Raise
   + M Move
   + D Max
 
AddToFunc RaiseAndResize
   + I Raise
   + I Resize
 
AddToFunc MoveAndGotoPage
   + I MoveToPage $*
   + I GotoPage $*
 
AddToFunc HidePanel
   + I Next (FvwmButtons) Iconify
   + I Next (term_tiny)   Iconify
 
# Alt-tab window cycle
SetEnv DIR Next
 
AddToFunc FocusRaiseAndStuff
   + I Iconify off
   + I Focus
   + I Raise
 
AddToFunc SwitchWindow
  + I $[DIR] (CurrentPage, !Iconic, !Sticky) FocusRaiseAndStuff
  + I Deschedule 134000
  + I PipeRead `[ "$[DIR]" == "Prev" ] && \
      echo 'SetEnv NDIR Next' || \
      echo 'SetEnv NDIR Prev'`
  + I Schedule 700 134000 SetEnv DIR $[NDIR]
 
DestroyFunc Thumbnail
AddToFunc Thumbnail
     + I Raise
     + I ThisWindow (!Shaded, Iconifiable, !Iconic) PipeRead \
         "xwd -silent -id $[w.id] | convert -scale 192 -frame 1x1 \
         -mattecolor black -quality 0 xwd:- \
         png:$[FVWM_USERDIR]/icon.tmp.$[w.id].png \
         && echo WindowStyle IconOverride, \
         Icon $[FVWM_USERDIR]/icon.tmp.$[w.id].png \
         || echo Nop"
     + I Iconify
 
DestroyFunc DeThumbnail
AddToFunc DeThumbnail
     + I Exec rm -f $[FVWM_USERDIR]/icon.tmp.$[w.id].png
     + I DestroyWindowStyle
     + I Iconify no
 
#####
# FvwmExpose - http://www.zensites.net/fvwm/guide/advanced_functions.html
###########
DestroyFunc FvwmExpose
AddToFunc FvwmExpose
+ I AddToMenu FvwmExposeMenu "e x p o s e" Title
+ I + DynamicPopDownAction DestroyMenu FvwmExposeMenu
+ I All (!Iconic !Shaded AcceptsFocus)\
    PipeRead "echo Raise; \
        xwd -silent -id $[w.id] | convert -scale $$(($[w.width]/10)) -quality 0 xwd:- \
        png:$[fvwm_home]/tmp/icon.exp.$[w.id].png \
	&& echo AddToMenu FvwmExposeMenu \
	%$[fvwm_home]/tmp/icon.exp.$[w.id].png%\\\'\"$[w.name]\"\\\' WindowID $[w.id] WarpToWindow 50 50 \
        && echo AddToMenu FvwmExposeMenu \\\"\\\" Nop \
    || Nop"
+ I Popup FvwmExposeMenu
+ I Exec exec rm -f $[fvwm_home]/tmp/icon.exp.*
 
 
 
*FvwmIconBoxPlacement Bottom Left 
 
#################################### Menus ####################################
 
AddToMenu WindowOpsMenu "Window Ops" Title
   + "Identify"             FvwmIdent
   + "Iconify"              Iconify
   + "Shade/Unshade"        WindowShade
   + "(Un)Maximize"         Max
   + "(Un)Maximize Vert."   VertMax
   + "(Un)Maximize Horiz."  HorMax
   + "Stick/Unstick"        Stick
   + "Move"                 Move
   + "Resize"               Resize
   + "Close"                Close
   + "Kill"                 Destroy
 
 
################################# Mouse Ops ###################################
 
# No builtin root menu
Mouse 0 R N -
 
Mouse 3 R A  FvwmExpose
 
# Root menus
Mouse 2 R N Menu  BackgroundsMenu
Mouse 3 R N Menu  MP3PlaylistMenu
Silent Mouse 6 R N Menu  CDPlaylistMenu
Silent Mouse 7 R N WindowList NoDeskNum, NoNumInDeskTitle, NoGeometryWithInfo, IconifiedAtEnd, MaxLabelWidth 30
 
# Raise and Focus via button 6 on window
Silent Mouse 6 FSTW N RaiseAndFocus
 
# Pop up a window-ops menu via button 7 on window
Silent Mouse 7 FSTW N Menu WindowOpsMenu
 
# Titlebar
Mouse 1 T N WindowLeftClick
Mouse 2 T N Thumbnail
Mouse 3 T N Popup WindowOpsMenu
 
# Titlebar Buttons
Mouse 0 1 N  Popup WindowOpsMenu
Mouse 0 2 N  Close
Mouse 1 4 N  Max
Mouse 2 4 N  HorMax
Mouse 3 4 N  VertMax
Mouse 1 6 N  WindowShade
 
# Sides & Corners: Resize
Mouse 1 FS N Resize
Mouse 3 FS N Resize
 
# Mouse-grab with alt for various window ops, click anywhere on a window
Mouse 1 FSTW M WindowLeftClick
Mouse 2 FSTW M Thumbnail
Mouse 3 FSTW M RaiseAndResize
 
# Resize the thumbnail
Mouse 1 I N DeThumbnail
 
################################ Key Bindings #################################
 
# Save alt-tab for emacs
#Key Tab A M -
 
# Circulate with left and right "window" keys
Key F13  A N  Prev (CurrentPage !Sticky !Shaded) RaiseAndFocus
Key F14  A N  Next (CurrentPage !Sticky !Shaded) RaiseAndFocus
 
# Focus the tiny xterm via alt-enter
Key Return  A M  Next (term_mutt) RaiseAndFlipFocus
# Focus Opera with alt-ctrl-enter
Key Return  A C  Next (opera)     RaiseAndFlipFocus
 
# Hide/unhide the panel with Alt-F1
Key F1 A M HidePanel
 
# Shade with the keypad '/'
Key KP_Divide    A N WindowShade
 
# Maximize various ways with the '*' keypad key
Key KP_Multiply  A N Max
Key KP_Multiply  A C HorMax
Key KP_Multiply  A M VertMax
Key KP_Multiply  A S SemiMax
 
# Open a new mozilla window via Alt-F7
Key F7   A M  Exec url_handler.sh file:/home/tril
 
# Music Controls
#Key KP_Enter     A N  Exec ctunez -play
#Key KP_Enter     A M  Exec trix play
#Key KP_Delete    A N  Exec ctunez -stop
#Key KP_Subtract  A N  Exec ctunez -prev
#Key KP_Add       A N  Exec ctunez -next
#Key KP_Subtract  A C  Exec ctunez -rewind 30
#Key KP_Add       A C  Exec ctunez -ff 30
#Key Pause        A N  Exec ctunez -pause
# "Media" button:
#Key F34          A N  Exec ctunez -shuffle /music
 
### Keypad Directional Controls ###
 
# Switch pages via keypad (no modifier)
Key KP_Home  A N  GotoPage  0 0
Key KP_Up    A N  GotoPage  1 0
Key KP_Prior A N  GotoPage  2 0
Key KP_Left  A N  GotoPage  0 1
Key KP_Begin A N  GotoPage  1 1
Key KP_Right A N  GotoPage  2 1
Key KP_End   A N  GotoPage  0 2
Key KP_Down  A N  GotoPage  1 2
Key KP_Next  A N  GotoPage  2 2
 
# Switch pages via arrow keys
Key Left     A CM  GotoPage  -1p  0p
Key Right    A CM  GotoPage  +1p  0p
Key Up       A CM  GotoPage   0p -1p
Key Down     A CM  GotoPage   0p +1p
 
# Move windows to strategic points on the current page via shift-keypad
Key KP_Home  A S  Move   0     0
Key KP_End   A S  Move   0    -0
Key KP_Prior A S  Move  -0     0
Key KP_Next  A S  Move  -0    -0
Key KP_Up    A S  Move 136p    0
Key KP_Down  A S  Move 136p   -0
Key KP_Left  A S  Move 136p   keep
Key KP_Right A S  Move  -0    keep
Key KP_Begin A S  PipeRead 'fvwm_center_window $[vp.width] $[vp.height] $[w.width] $[w.height]'
 
# Move a window to a different page via alt-keypad
Key KP_Home  A M  MoveToPage  0 0
Key KP_Up    A M  MoveToPage  1 0
Key KP_Prior A M  MoveToPage  2 0
Key KP_Left  A M  MoveToPage  0 1
Key KP_Begin A M  MoveToPage  1 1
Key KP_Right A M  MoveToPage  2 1
Key KP_End   A M  MoveToPage  0 2
Key KP_Down  A M  MoveToPage  1 2
Key KP_Next  A M  MoveToPage  2 2
 
# Move a window and follow it via ctrl-keypad
Key KP_Home  A C  MoveAndGotoPage  0 0
Key KP_Up    A C  MoveAndGotoPage  1 0
Key KP_Prior A C  MoveAndGotoPage  2 0
Key KP_Left  A C  MoveAndGotoPage  0 1
Key KP_Begin A C  MoveAndGotoPage  1 1
Key KP_Right A C  MoveAndGotoPage  2 1
Key KP_End   A C  MoveAndGotoPage  0 2
Key KP_Down  A C  MoveAndGotoPage  1 2
Key KP_Next  A C  MoveAndGotoPage  2 2
 
# Grow a window using Shift+Ctrl+x
Key x	     A SC GrowMax
# Grow a window vertically using Shift+Crtl+DOWN
Key Down  A SC HorMax
 
############################### Global Styles #################################
 
Style * BorderWidth 4, GrabFocus, IgnoreRestack, MinOverlapPlacement
Style * NoPPosition, NoTransientPPosition, SloppyFocus
 
MenuStyle * TitleWarpOff, \
            VerticalItemSpacing 1 0, \
            MenuFace TiledPixmap marble.png, \
            Font -*-Verdana-medium-r-*-*-9-*-*-*-*-*-*-*
MenuStyle FancyMenu TitleWarpOff, \
                    VerticalItemSpacing 1 0, \
                    MenuFace TiledPixmap marble.png, \
                    SidePic fvwm_sidebar.png, \
                    Font -*-Verdana-medium-r-*-*-9-*-*-*-*-*-*-*
ChangeMenuStyle FancyMenu StartMenu BackgroundsMenu MP3PlaylistMenu CDPlaylistMenu
 
############################# App-Specific Styles #############################
 
Style * IconBox -80 0 -1 -1 , IconFill top right
 
Style gtklife              UsePPosition
Style tsk                  UsePPosition
Style tsk-remind           UsePPosition
Style FvwmButtons          NeverFocus, NoHandles, NoTitle, StaysOnBottom, Sticky, WindowListSkip
Style FvwmDesktop          NeverFocus
Style FvwmIdent            NoTitle
Style FvwmPager            NeverFocus, NoHandles, NoTitle, StaysOnBottom, Sticky, WindowListSkip
Style FvwmTaskBar          NeverFocus
Style MPlayer              NoTitle
Style "xine video output"  HandleWidth 0, NoTitle
Style xmms*                CirculateSkip, NoTitle, Sticky
Style xterm		   NoTitle, BorderWidth 3
Style term_*               NoTitle, BorderWidth 3 
Style xmessage		   NoTitle, Sticky, GrabFocus
Style fbrun		   NoTitle, BorderWidth 0, HandleWidth 0, GrabFocus
 
############################ MiniIcon Overrides ###############################
 
Style Emacs     MiniIcon editors.png
Style Mozilla*  MiniIcon netscape.png
 
################################# Colorsets ###################################
 
# Pager background & foreground
Colorset 2  TiledPixmap vvdark_wood.xpm, fg #C0C0C0
Colorset 3  bg #004020, fg #C0C0C0
# Pager inactive and active window colors
Colorset 4  bg #808080
Colorset 5  bg #502000
 
################################ Module Config ################################
 
*FvwmPager: Geometry           -10000-10000
*FvwmPager: MiniIcons
*FvwmPager: Colorset *         2
*FvwmPager: HilightColorset *  3
*FvwmPager: WindowColorsets    4 5
*FvwmPager: Window3DBorders
 
*FvwmButtons: ButtonGeometry   64x64+0+0
*FvwmButtons: Columns          2
*FvwmButtons: Back             #808080
*FvwmButtons: Frame            1
*FvwmButtons: (2x2, Swallow "FvwmPager" 'FvwmPager *')
*FvwmButtons: (2x2, Swallow (NoClose, UseOld) "xclock" 'Exec xclock')
*FvwmButtons: (2x1, Title Footprints, Icon "/home/pblair/.fvwm/tucows.xpm", Action `Exec "firefox" firefox http://footprints-internal.tucows.com/MRcgi/MRentrancePage.pl &` )
An example picture of one of my workspaces at work

An example picture of one of my workspaces at work

One of the things that I like about my setup, is that I can zoom to a particular workspace by hitting ctrl-enter, and have a particular application (or applications) brought to focus. Also, it allows me to thumbnail my applications to the screen since I don’t have any kind of taskbar, I cannot minimize.

FVWM With minimized screens

FVWM With minimized screens

If you’re a user of UNIX/Linux, then I’d very much recomend the time to get throught the growing pains of learning FVWM. It’s worth it.


Categorised as: Window Manager


Comments are closed.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes