# .fvwm2rc
#
# Originally, a modified version of the system.fvwm2rc that was
# included in the 2.0.46 source from 1998 (I think).
# Other bits and pieces sourced and removed over the years as my
# tastes changed.
#
# Set some defaults.
#
EdgeScroll 100 100
EdgeResistance 250
EdgeThickness 1
ClickTime 750
IgnoreModifiers L25
ColormapFocus FollowsMouse
DeskTopSize 3x1
# Define the menu style.
#
Menustyle * mwm, Font "Shadow=0 SE:xft:San:pixelsize=16:minspace=true"
MenuStyle * Foreground "#000000", Background "#AEB2C3"
# Define styles for windows and desktop behavior.
#
Style * Font "Shadow=0 SE:xft:Sans:pixelsize=16:minspace=true"
Style * HilightFore "#FFFFFF", HilightBack "#6495ED"
Style * BorderWidth 5, HandleWidth 5
Style * MWMFunctions, MWMDecor, HintOverride
Style * DecorateTransient, !UsePPosition, TileCascadePlacement
Style * SloppyFocus, MouseFocusClickRaises
Style * SnapAttraction 5 All
Style * NoIcon
Style * EdgeMoveDelay 250
Style * EdgeMoveResistance 250
# Define styles for various Fvwm modules.
# I haven't used the fvwm modules since about 2001.
# Well, that's not 'entirely' true... (ie: FvwmForms).
#
# Key and mouse bindings are always useful.
# I used to get soooo carried away with these, now I'm much more
# conservative with them.
#
# Key/Mouse X Context Modifier Action
# X: [Mouse 0=Any, 1=L, 2=M, 3=R] [Keyboard X=Key]
# Context: (A)nywhere (R)oot (T)itle (S)ide (F)rame (W)indow
# Modifier: (C)ontrol, (S)hift, (M)eta, (N)othing
#
# Root window bindings for the mouse menus.
Mouse 1 R A Nop
Mouse 2 R A WindowList
Mouse 3 R A Menu Root.Menu Nop
# Title bar buttons.
Mouse 0 1 A Menu Window.Ops.Menu Close
Mouse 0 2 A Maximize.Func
Mouse 0 4 A Iconify
# Title bar and frame/sides.
Mouse 1 FS A Resize.Raise.Lower
Mouse 1 T A Move.Raise.Lower.Shade
Mouse 1 I A Move.Iconify
Mouse 2 I A Iconify
Mouse 2 FST A Menu Window.Ops.Menu Nop
Mouse 3 TSIF A RaiseLower
# Key bindings for programs and workflow.
Key r A M Module FvwmForm RunDialog
Key space A M WindowShade
Key o A M Menu Root.Menu Nop
Key t A M Exec exec xterm
Key w A M Menu Window.Ops.Menu Nop
Key Right A CM GoToPage wrapx +1p 0
Key Left A CM GoToPage wrapx -1p 0
Key m A CM Move
Key r A CM Resize
Key Up A CM Raise
Key Down A CM Lower
Key s A CM Stick
Key c A CM Close
Key i A CM Iconify
Key Delete A CM Module FvwmForm ShutDownReboot
# Initialization Function.
#
# This can be used for so much more.
# Now I just use it to set the background color.
DestroyFunc StartFunction
AddToFunc StartFunction
+ I Test (Init) Exec exec xsetroot -solid '#2f426c'
# Construct the various menus.
#
# Root menu - main parent menu from mouse right-click.
# Gives me a few applications at the top and then sources the various
# other menus and such.
DestroyMenu Root.Menu
AddToMenu Root.Menu
+ "Fvwm Menu" Title
+ "Terminal Emulator" Exec exec xterm
+ "Web Browser" Exec exec firefox
+ "File Manager" Exec exec thunar
+ "Run A Program" Module FvwmForm RunDialog
+ "" Nop
+ "" Nop
+ "Applications" Popup Applications.Submenu
+ "Utilities" Popup Utilities.Submenu
+ "Games" Popup Games.Submenu
+ "" Nop
+ "Window Ops" Popup Window.Ops.Menu
+ "Refresh" Refresh
+ "" Nop
+ "Exit Fvwm" Popup Quit.Verify.Submenu
# All the rest of my applicationsgo in here somewhere.
DestroyMenu Applications.Submenu
AddToMenu Applications.Submenu
+ "Applications" Title
+ "Firefox" Exec exec firefox
+ "Chrome" Exec exec chrome
+ "Libre Office" Popup LibreOffice.Submenu
+ "" Nop
# LibreOffice - Full suite or just individual apps
DestroyMenu LibreOffice.Submenu
AddToMenu LibreOffice.Submenu
+ "Libre Office" Title
+ "Full Office Suite" Exec exec libreoffice
+ "Writer (Document)" Exec exec libreoffice --writer
+ "Calc (Spreadsheet)" Exec exec libreoffice --calc
+ "Draw (Drawing)" Exec exec libreoffice --draw
+ "Impress (Presentation)" Exec exec libreoffice --impress
+ "Math (Formula)" Exec exec libreoffice --math
+ "Base (Database)" Exec exec libreoffice --base
# System utilities and the such.
DestroyMenu Utilities.Submenu
AddToMenu Utilities.Submenu
+ "Utilities" Title
+ "Top" Exec exec xterm -T Top -n Top -e top
+ "Calculator" Exec exec xcalc
+ "Mixer" Exec exec xmix
+ "" Nop
+ "VirtualBox" Exec exec virtualbox
+ "Editor " Exec exec gvim
+ "" Nop
+ "Screenshot" Exec exec import -window root screenshot.jpg
+ "" Nop
# Sometimes I get bored and want to play.
DestroyMenu Games.Submenu
AddToMenu Games.Submenu
+ "Games" Title
+ "Minecraft" Exec exec java -jar ~/.bin/minecraft
+ "WarZone 2100" Exec exec warzone2100
# Operations menu for windows.
DestroyMenu Window.Ops.Menu
AddToMenu Window.Ops.Menu
+ "Move" Move
+ "Resize" Resize
+ "Raise" Raise
+ "Lower" Lower
+ "(De)Iconify" Iconify
+ "(Un)Stick" Stick
+ "(Un)Maximize" Maximize
+ "" Nop
+ "Delete" Delete
+ "Close" Close
+ "Destroy" Destroy
# Standard QV submenu for Fvwm, been around as long as I can remember
# ... with a few changes.
DestroyMenu Quit.Verify.Submenu
AddToMenu Quit.Verify.Submenu
+ "Really Quit Fvwm?" Title
+ "No, Just Restart" Restart
+ "" Nop
+ "No, Don't Quit" Nop
+ "Yes, Really Quit" Quit
# All the functions that have been called and referred to up above.
# Most of them are explained by their name.
#
# Moves, raises, lowers, or shades a window.
DestroyFunc Move.Raise.Lower.Shade
AddToFunc Move.Raise.Lower.Shade
+ I Raise
+ M Move
+ D WindowShade
# Controls how to window is maximized and returned.
DestroyFunc Maximize.Func
AddToFunc Maximize.Func
+ M Maximize 0 100
+ C Maximize 0 80
+ D Maximize 100 100
# Move or iconify the window.
DestroyFunc Move.Iconify
AddToFunc Move.Iconify
+ I Raise
+ M Move
+ D Iconify
# Resize, raise, or lower (obviously).
DestroyFunc Resize.Raise.Lower
AddToFunc Resize.Raise.Lower
+ I Raise
+ M Resize
+ D Lower
# FvwmForms is so useful.
# I used to have quite a bit of these too but have replaced them with
# full blown utilities and applications over the years.
# These are still my favorites though so I keep them.
#
# RunDialog (pretty much explains itself).
*RunDialog: WarpPointer
*RunDialog: Fore #000000
*RunDialog: Back #AEB2C3
*RunDialog: ItemFore #000000
*RunDialog: ItemBack #AEB2C3
*RunDialog: Line center
*RunDialog: Text "Run Program"
*RunDialog: Input Func 40 ""
*RunDialog: Line expand
*RunDialog: Button quit "Run" ^M
*RunDialog: Command Exec $(Func)
*RunDialog: Button quit "Cancel" ^C
*RunDialog: Command Nop
# ShutDown, Reboot, or Cancel dialog.
*ShutDownReboot: GrabServer
*ShutDownReboot: WarpPointer
*ShutDownReboot: Fore #000000
*ShutDownReboot: Back #AEB2C3
*ShutDownReboot: ItemFore #000000
*ShutDownReboot: ItemBack #AEB2C3
*ShutDownReboot: Line center
*ShutDownReboot: Text "Shutdown: Are you sure?"
*ShutDownReboot: Line expand
*ShutDownReboot: Button quit " Halt "
*ShutDownReboot: Command Exec (sudo /sbin/shutdown -p now)
*ShutDownReboot: Button quit " Reboot "
*ShutDownReboot: Command Exec (sudo /sbin/shutdown -r now)
*ShutDownReboot: Button quit "Cancel"
*ShutDownReboot: Command Nop