# -*- mode: fvwm; fill-column: 90 -*-################################################################# Help on syntax.# DestroyFunc FuncName# AddToFunc FuncName# + I (Action to happen immediately)# + C (Action to happen on a mouse 'click)# + D (Action to happen on a mouse 'double click')# + H (Action to happen on a mouse 'hold')# + M (Action to happen on a mouse 'motion')# Mouse [(window)] Button Context Modifiers Function# Button# 1 left# 2 right# 3 middle# Context# ’R’ for the root window# ’W’ for an application window# ’D’ for a desktop application (as kdesktop or Nautilus desktop)# ’T’ for a window title-bar# ’S’ for a window side, top, or bottom bar,# ’[’, ’]’, ´-’ and ’_’ for the left, right, top or bottom side only# ’F’ for a window frame (the corners),# ’<’, ’^’, ’>’ and ’v’ for the top left, top right, bottom right or bottom left corner,# ’I’ for an icon window# ’0’ through ’9’ for title-bar buttons# ’A’ is for any context# Modifiers# ’N’ for no modifiers# ’C’ for control# ’S’ for shift# ’M’ for Meta# ’L’ for Caps-Lock# ’A’ for any modifier# Key [(window)] Keyname Context Modifiers Function# See Keyname on /usr/include/X11/keysymdef.h, without the XK_ prefix.# Use Bash for PIPESTATUS.ExecUseShell /bin/bash################################################################# Debugging code.# BugOpts DisplayNewWindowNames on# BugOpts DisplayNewWindowNames off# BugOpts ExplainWindowPlacement on# BugOpts ExplainWindowPlacement off# KillModule FvwmDebug# Module FvwmDebug -m -1################################################################# Set paths.m4_define(`m4_IMGPATH', `$[FVWM_USERDIR]/images')m4_dnlm4_define(`m4_ICONPATH', `$[FVWM_USERDIR]/icons')m4_dnlModulePath $[FVWM_USERDIR]:+ImagePath m4_ICONPATH:m4_IMGPATH:+# Debian paths.ImagePath +:/usr/share/icons/gnome/16x16/placesImagePath +:/usr/share/icons/gnome/32x32/appsImagePath +:/usr/share/icons/gnome-colors-common/32x32/appsImagePath +:/usr/share/icons/locolor/32x32/apps# ImagePath +:/usr/share/icons/hicolor/16x16/appsImagePath +:/usr/share/icons/hicolor/22x22/appsImagePath +:/usr/share/icons/hicolor/24x24/appsImagePath +:/usr/share/icons/hicolor/32x32/appsImagePath +:/usr/share/icons/hicolor/48x48/apps# ImagePath +:/usr/share/icons/hicolor/64x64/apps# This paths contain large icons for some apps, they make menus look ugly...# ImagePath +:/usr/share/app-install/icons/# ImagePath +:/usr/share/pixmaps################################################################# Set aliases to common values.m4_define(`m4_MONOFONT', `-misc-fixed-medium-r-semicondensed-*-13-120-*-*-*-*-iso10646-1')m4_dnlm4_define(`m4_BIGMONOFONT', `-misc-fixed-medium-r-*-*-18-*-*-*-*-*-iso10646-1')m4_dnl# As args expected class name.m4_define(`m4_XTERM_MC',`xterm -name $1 -fn "'m4_BIGMONOFONT`" -geometry 136x42 -e bash -i -c "mc -x"')m4_dnl################################################################# Startup functions.# Run only on sturtup.DestroyFunc InitFunctionAddToFunc InitFunction# Right offset: 80 from FvwmPager + 2*6 from border = 92.+ I Exec exec xclock -digit -update 1 -strftime '%m-%d %T %a' -padding 2 -geometry 130x16-92+0 -face Monospace-9 -bg gray+ I Exec exec stalonetray --window-strut none --grow-gravity S --icon-gravity N --geometry 1x16-$((130+92+24))+0 + I Exec exec m4_XTERM_MC(`mc-main1')+ I Exec exec m4_XTERM_MC(`mc-main2')# Run after each restart.DestroyFunc RestartFunctionAddToFunc RestartFunction# Run at sturtup and after each restart.# All fvwm modules exit after restart Fvwm, so you must put they there.DestroyFunc StartFunctionAddToFunc StartFunction# + I Module FvwmDebug --xconsole# + I KillModule FvwmDebug# + I Module FvwmGtkDebug# + I Module FvwmConsole+ I Module FvwmCommandS+ I Module FvwmPager 0 4+ I Module FvwmKbdd.pl# Add next to load desktop image (must be .xpm or .png)# + I Exec fvwm-root -r ~/tmp/MagicItemComp2_1280x1024.png################################################################# Window Styles.Style * BorderWidth 6, HandleWidth 6# NoDecorHint, OLDecor, MwmDecor# MwmDecor remove border from transient windows (like Firefox network log) so you can't resize/close this windows.Style * NoDecorHint# MwmBorder, FvwmBorder, DepressableBorder, FirmBorderStyle * MwmBorder# MwmButtons, FvwmButtonsStyle * MwmButtons# Mwm and Win style menus popup sub menus automatically and never overlap the parent menu.# Available: Fvwm, Mwm, Win.MenuStyle * MwmDefaultFont m4_MONOFONTMenuStyle * Font m4_MONOFONTStyle * DecorateTransientStyle * TitleFormat %n «%c:%r»DestroyDecor MyDecorAddToDecor MyDecor+ TitleStyle LeftJustified Height 16+ ButtonStyle 1 ActiveUp Vector 4 30x30@3 60x60@3 60x30@4 30x60@3 -- Flat+ ButtonStyle 1 ActiveDown Vector 4 30x30@1 60x60@1 60x30@4 30x60@1 -- Flat+ ButtonStyle 1 Inactive Vector 4 30x30@3 60x60@3 60x30@4 30x60@3 -- Flat+ ButtonStyle 3 ActiveUp Vector 5 30x60@3 60x60@3 60x50@3 30x50@3 30x60@3 -- Flat+ ButtonStyle 3 ActiveDown Vector 5 30x60@1 60x60@1 60x50@1 30x50@1 30x60@1 -- Flat+ ButtonStyle 3 Inactive Vector 5 30x60@3 60x60@3 60x50@3 30x50@3 30x60@3 -- Flat+ ButtonStyle 5 ActiveUp Vector 7 30x30@3 30x60@3 60x60@3 60x30@3 30x30@3 30x35@3 60x35@3 -- Flat+ ButtonStyle 5 ActiveDown Vector 7 30x30@1 30x60@1 60x60@1 60x30@1 30x30@1 30x35@1 60x35@1 -- Flat+ ButtonStyle 5 Inactive Vector 7 30x30@3 30x60@3 60x60@3 60x30@3 30x30@3 30x35@3 60x35@3 -- FlatStyle * UseDecor MyDecor################################################################# Windows moving and resizing behaviour.# If during an interactive move the window or icon comes within proximity pixels of# another the window or icon, it is moved to make the borders adjoin.Style * SnapAttraction 10 SameTypeStyle * !Iconifiable# This disable ResizeOpaque, which cause frequent redrawing of applications.Style * ResizeOutline# Default is TileCascadePlacement.Style * MinOverlapPlacement# Ignore PPosition hint. Many programs set PPosition to something obnoxious like 0,0 (upper left corner).Style * !UsePPosition# Percentage of a page to scroll when the cursor hits the edge of a page.# With 0 0 I can't scroll to other page by hitting edge, but can move app to another page!# With 100 100 by hitting edge I move to next page.EdgeScroll 0 0# Tells how hard it should be to change the desktop viewport by moving the mouse over the# edge of the screen and how hard it should be to move a window over the edge of the screen.EdgeResistance 150Style * EdgeMoveDelay 150Style * EdgeMoveResistance 150# Width or height of the invisible window that fvwm creates on the edges of the screen that# are used for the edge scrolling feature.EdgeThickness 1################################################################# Program Styles.Style * Icon app/x-32x32.xpm, \ MiniIcon app/x-flex-16x16.xpmStyle "XTerm" Icon app/terminal-16x16.xpm, \ MiniIcon app/terminal-16x16.xpmStyle "rxvt" Icon app/terminal-16x16.xpm, \ MiniIcon app/terminal-16x16.xpmStyle "mc-*" Icon app/mc-16x16.xpm, \ MiniIcon app/mc-16x16.xpm# Define places for autoloaded programs.# StartsOnPage [desk [x y]]Style "mc-main1" StartsOnPage 0 1 0, SkipMappingStyle "mc-main2" StartsOnPage 0 2 0, SkipMapping# SkipMapping was not added to emacs to give focus it.Style "emacs-main" StartsOnPage 2 0 0Style "Goldendict" StartsOnPage 3 1 2, SkipMappingStyle "Iceweasel" StartsOnPage 1 0 0, SkipMappingStyle "XClock" !Title, Sticky, StaysOnTop, !Iconifiable, FixedPosition, FixedSize, WindowListSkip, CirculateSkip# DestroyStyle "stalonetray"Style "stalonetray" !Button 1, !Button 3, !Button 5Style "stalonetray" StaysOnTop, Sticky, !IconifiableStyle "stalonetray" FixedPosition, FixedSizeStyle "stalonetray" WindowListSkip, CirculateSkipStyle "stalonetray" TitleFormat TRY################################################################# Virtual Desktops.DesktopSize 3x3DesktopName 0 MainDesktopName 1 NetDesktopName 2 WorkDesktopName 3 MediaDesktopName 4 Games################################################################# Focus Behavior.ClickTime 350# How many pixels to move in order to distinct click from drag.MoveThreshold 3# GrabFocusTransient, ClickToFocusRaisesStyle * SloppyFocus, ClickToFocusStyle * !FPClickRaisesFocused, !FPClickRaisesUnfocusedStyle * FPClickDecorRaisesFocused, FPClickIconRaisesFocusedStyle * FPClickDecorRaisesUnfocused, FPClickIconRaisesUnfocused# Colormap is the one for the window that currently has the keyboard focus.ColormapFocus FollowsFocusDestroyFunc MyFuncFocusWindowAddToFunc MyFuncFocusWindow+ I FlipFocus+ I WarpToWindow 50 50DestroyModuleConfig FvwmEvent-NewWindow*FvwmEvent-NewWindow: Cmd*FvwmEvent-NewWindow: Delay 1*FvwmEvent-NewWindow: StartDelay 10*FvwmEvent-NewWindow: add_window MyFuncFocusWindowDestroyFunc MyFuncStartMaximisedAddToFunc MyFuncStartMaximised+ I ThisWindow ("Xpdf", "win") Maximize TrueDestroyModuleConfig FvwmEvent-StartMaximised*FvwmEvent-StartMaximised: Cmd*FvwmEvent-StartMaximised: add_window MyFuncStartMaximisedAddToFunc StartFunction I Module FvwmEvent# TODO: have problem with Emacs ediff frame.# AddToFunc StartFunction I FvwmEvent FvwmEvent-NewWindowAddToFunc StartFunction I FvwmEvent FvwmEvent-StartMaximised# Start on screen with pointer.# Style * StartsOnScreen c# Fix for broken Java based GUI.# Style "sun-awt-X11-*" MouseFocusClickRaises, Lenience# Style "com-pb-*" MouseFocusClickRaises, Lenience################################################################# Multi-monitor setup.# Xinerama On# XineramaPrimaryScreen 0################################################################# Screenshot Functions (uses ImageMagick).m4_define(`m4_SCREENSHOTPATH', `$[HOME]/.screenshot')m4_dnlm4_changequote(`<--', `-->')m4_dnlDestroyFunc FvwmWindowScreenshotAddToFunc FvwmWindowScreenshot+ I Exec import -window $[w.id] -quality 100 -silent \ "m4_SCREENSHOTPATH/$[w.class]-`date +%F[%R]`.png"# Remember there is 5 seconds pause before screenshot makes!# For alternative screenshot command with delay you may use: scrot -d <sec> <file>DestroyFunc FvwmDesktopScreenshotAddToFunc FvwmDesktopScreenshot+ I Exec import -window root -quality 100 -pause 5 -silent \ "m4_SCREENSHOTPATH/Desktop-`date +%F-[%H:%M:%S]`.png"DestroyFunc FvwmScreenshotAddToFunc FvwmScreenshot+ I Exec import -quality 100 -silent \ "m4_SCREENSHOTPATH/App-`date +%F-[%H:%M:%S]`.png"m4_changequote`'m4_dnl################################################################# Modifier settings.# L - caps-lock.# With XFree86 '2' usually is the num-lock modifier and '5' refers to the scroll-lock key.IgnoreModifiers L25################################################################# Mouse binding.DestroyFunc FvwmDeleteOrDestroyAddToFunc FvwmDeleteOrDestroy+ C Delete+ D DestroyDestroyFunc FvwmSmartMaximizeAddToFunc FvwmSmartMaximize+ C Maximize 100 100+ D Maximize grow grow# Setup title-bar button actions.Mouse 1 1 A FvwmDeleteOrDestroyMouse 1 3 A WindowShadeMouse 1 5 A FvwmSmartMaximizeMouse 2 5 A Maximize 100 0Mouse 3 5 A Maximize 0 100DestroyFunc FvwmMoveAddToFunc FvwmMove+ I Raise+ M Move+ D WindowShade# Move windows by holding left mouse button on window title.Mouse 1 T A FvwmMove# Move windows by holding right mouse button on window title, borders or corners.Mouse 3 FST A FvwmMove################################################################# WindowList.# Used by WindowList to raise selected windows and to pass focus to it.DestroyFunc WindowListFuncAddToFunc WindowListFunc+ I Iconify off+ I FlipFocus+ I Raise# Place mouse pointer in center of window.+ I WarpToWindow 50 50# Sort by focus.Style * FPSortWindowlistByFocus# Prevent show long title.m4_define(`m4_WINLIST_CONF',`NoDeskSort, NoGeometryWithInfo, NoDeskNum, NoCurrentDeskTitle, CurrentAtEnd, MaxLabelWidth 80')m4_dnl# Define switch between aps.# Key Tab A M WindowList Root c c m4_WINLIST_CONF, SelectOnRelease Meta_LKey Tab A M WindowList Root c c m4_WINLIST_CONF, SelectOnRelease################################################################# Key binding.# Close window by Alt+F4 (send SIGHUP).Key F4 A M Delete# Close window by LeftWin+F4 (delete window protocol).DestroyFunc MyCloseAddToFunc MyClose+ I ThisWindow CloseKey F4 W 3 MyCloseKey F12 A 3 Maximize 100 100# Make screenshot.Key Print A N FvwmScreenshotKey Print A S FvwmDesktopScreenshotKey Scroll_Lock A N Exec exec xscreensaver-command -activate# Similar to Vi hjkl:## F11 - up# F9 - left F12 - right# F10 - downDestroyFunc myGotoPageAddToFunc myGotoPage+ I Next (CirculateHit, FvwmPager, Shaded) WindowShade "False"+ I GotoPage $0 $1Key F9 A C myGotoPage -1p -0pKey F12 A C myGotoPage +1p +0p# Move across page up, if no page more go to last page of prev desk.DestroyFunc myGotoPageUpAddToFunc myGotoPageUp+ I Next (CirculateHit, FvwmPager, Shaded) WindowShade "False"+ I SetEnv fvwm_page_ny $[page.ny]+ I Test (EnvMatch fvwm_page_ny 0) Nop+ I TestRc (Match) GotoDesk -1 0 4+ I TestRc (Match) GotoPage +0p 2+ I TestRc (NoMatch) GotoPage +0p -1p+ I UnSetEnv fvwm_page_nyKey F11 A C myGotoPageUp# Move across page down, if no page more go to first page of next desk.DestroyFunc myGotoPageDownAddToFunc myGotoPageDown+ I Next (CirculateHit, FvwmPager, Shaded) WindowShade "False"+ I SetEnv fvwm_page_ny $[page.ny]+ I Test (EnvMatch fvwm_page_ny 2) Nop+ I TestRc (Match) GotoDesk +1 0 4+ I TestRc (Match) GotoPage +0p 0+ I TestRc (NoMatch) GotoPage +0p +1p+ I UnSetEnv fvwm_page_nyKey F10 A C myGotoPageDownKey F9 A S CursorMove -50p +0pKey F10 A S CursorMove +0p +50pKey F11 A S CursorMove +0p -50pKey F12 A S CursorMove +50p +0p# Switch input method.Key 1 A 3 SendToModule FvwmKbdd.pl kbdd 0Key 2 A 3 SendToModule FvwmKbdd.pl kbdd 1Key 3 A 3 SendToModule FvwmKbdd.pl kbdd 2# Win+R like in Windows.Key R A 3 Exec exec gmrun# Win+L like in Windows (lock the computer).Key L A 3 Exec exec xscreensaver-command -lock# Make quick note on current desktop page.Key T A 3 Exec exec emacsclient -cKey Page_Up A 3 Exec xdotool click 4Key Page_Down A 3 Exec xdotool click 5################################################################# Menu.# Read generated by update-menu "/Debian" menu.# To add own menu items create proper ~/.menu/app-name file and run update-menu.# About this you can rean in /usr/share/doc/menu/menu.txt.gz.Read /etc/X11/fvwm/menudefs.hook quiet# Read $[FVWM_USERDIR]/menudefs.hook quietDestroyMenu MenuMyAddToMenu MenuMy "My Menu" Title+ &HTop%/usr/share/app-install/icons/htop.png% Exec exec xterm -name htop -title HTop -geometry +10+10 -e sudo htop+ &Emacs%emacs.png% Exec exec emacs+ &Firefox%iceweasel.png% Exec exec firefox+ &VLC%vlc.png% Exec exec vlc+ &Skype%skype.png% Exec exec skype+ &Goldendict%goldendict.png% Exec exec goldendict+ xkill Exec exec xkillDestroyMenu MenuMyDevAddToMenu MenuMyDev "My Dev Menu" Title+ &Firefox%iceweasel.png% Exec exec firefox -no-remote -P devel+ &Netbeans%netbeans.png% Exec exec $(ls /opt/*/bin/netbeans 2>/dev/null | tail -n 1; [[ ${PIPESTATUS[0]} -gt 0 ]] && { command -v netbeans || echo xmessage "\"Can't find 'Netbeans' in PATH or /opt\""; })+ "SQL Developer" Exec exec $(ls /opt/*/sqldeveloper.sh 2>/dev/null | tail -n 1; [[ ${PIPESTATUS[0]} -gt 0 ]] && echo xmessage "Can't find 'SQL Developer' in /opt")+ "Squirrel" Exec exec $(ls /opt/*/squirrel-sql.sh 2>/dev/null | tail -n 1; [[ ${PIPESTATUS[0]} -gt 0 ]] && echo xmessage "Can't find 'Squirrel' in /opt")# Drawback - you can not make it smaller.Style "htop" MinWindowSize 98 98DestroyFunc MyIdentAddToFunc MyIdent+ I WindowId root Focus+ I Module FvwmIdentDestroyMenu MenuWindowOperationsAddToMenu MenuWindowOperations "Window Operations" Title+ "Identify%menu/window-identify.xpm%" MyIdent+ "" Nop+ "Close%menu/window-close.xpm%" Close+ "Delete%menu/window-delete.xpm%" Delete+ "Destroy%menu/window-destroy.xpm%" Destroy+ "" Nop+ "DPMS suspend%app/xset-dpms-suspend-16x16.xpm%" Exec xset dpms force suspend+ "DPMS on%app/xset-dpms-on-16x16.xpm%" Exec xset +dpms s on+ "DPMS off%app/xset-dpms-off-16x16.xpm%" Exec xset -dpms s off+ "XScreensaver%app/xscreensaver-16x16.xpm%" Exec xscreensaver-command -lock+ "" Nop+ "Move%menu/window-move.xpm%" Move+ "Resize%menu/window-resize.xpm%" Resize+ "(De)Iconify%menu/window-iconify.xpm%" Iconify+ "(Un)Maximize%menu/window-maximize.xpm%" Maximize+ "(Un)Shade%menu/window-shade.xpm%" WindowShade+ "(Un)Stick%menu/window-stick.xpm%" Stick+ "" Nop+ "StaysOnTop%menu/window-raise.xpm%" Pick (CirculateHit) Layer 0 6+ "Layer +1%menu/window-raise.xpm%" Pick (CirculateHit) Layer +1+ "StaysPut%menu/window.xpm%" Pick (CirculateHit) Layer 0 4+ "Layer -1%menu/window-lower.xpm%" Pick (CirculateHit) Layer -1+ "StaysOnBottom%menu/window-lower.xpm%" Pick (CirculateHit) Layer 0 2+ "" Nop+ "%menu/window.xpm%App Screenshot" Pick (CirculateHit) FvwmWindowScreenshot+ "Screenshot" FvwmDesktopScreenshotMouse 3 R A Menu MenuWindowOperations# Use interactive bash mode to read profile (~/.bashrc) to override default# value of PS1.AddToMenu MenuMyRoot Menu Title+ "Xterm%app/terminal-16x16.xpm%" Exec exec xterm -e bash -i+ "Mc%app/mc-16x16.xpm%" Exec exec m4_XTERM_MC(`mc-secondary')+ "" Nop+ &Debian%menu/submenu-16x16.xpm% Popup "/Debian"+ &My%menu/submenu-16x16.xpm% Popup MenuMy+ MyDev%menu/submenu-16x16.xpm% Popup MenuMyDev+ &Window%menu/submenu-16x16.xpm% Popup MenuWindowOperations+ &Fvwm%menu/submenu-16x16.xpm% Popup MenuFvwmRoot+ "" NopKey F1 A M Menu MenuMyRoot Root c cMouse 1 R A Menu MenuMyRoot Nop################################################################# FvwmTaskBar.Style "FvwmTaskBar" NoTitle, !Handles, !Borders, Sticky, WindowListSkip, CirculateSkip, StaysOnBottom, FixedPosition, FixedSize, !Iconifiable################################################################# FvwmPager.# No any button on pager.Style "FvwmPager" !Button 1, !Button 3, !Button 5, \ StaysOnTop, Sticky, FixedPosition, FixedSize, !Iconifiable, \ WindowListSkip, CirculateSkipStyle "FvwmPager" TitleFormat %nm4_define(`m4_PagerInactiveRGB', `rgb:c0/c0/c0')m4_dnlm4_define(`m4_PagerActiveRGB', `rgb:ef/df/bd')m4_dnlDestroyModuleConfig FvwmPager: **FvwmPager: Back m4_PagerInactiveRGB*FvwmPager: BalloonBack m4_PagerActiveRGB*FvwmPager: Hilight m4_PagerActiveRGB*FvwmPager: Geometry 80x500-0+0*FvwmPager: WindowColors m4_PagerInactiveRGB m4_PagerInactiveRGB m4_PagerActiveRGB m4_PagerActiveRGB*FvwmPager: Font "xft:Sans:Bold:pixelsize=12:minspace=True:antialias=True"*FvwmPager: Balloons All*FvwmPager: BalloonFont m4_MONOFONT*FvwmPager: MiniIcons*FvwmPager: UseSkipList*FvwmPager: LabelsAbove# As I use only columns row count calculated automatically.# *FvwmPager: Rows 5*FvwmPager: Columns 1################################################################# FvwmAuto.# The autohiding functions.# From http://fvwm.org/documentation/faq/#toc_7.17# See question "Autohiding FvwmButtons or other windows".DestroyFunc autohideAddToFunc autohide+ I ThisWindow ($0) Deschedule $[w.id]+ I ThisWindow ($0) KeepRc ThisWindow (shaded) WindowShade off+ I TestRc (!Match) All ($0, !shaded) autohide_hide $1 $2DestroyFunc autohide_hideAddToFunc autohide_hide+ I Schedule $0 $[w.id] WindowShade $1+ I Schedule $0 $[w.id] Deschedule $[w.id]# Add the windows you want to autohideDestroyFunc enter_handlerAddToFunc enter_handler+ I autohide FvwmPager 1000 N+ I autohide stalonetray 1000 NAddToFunc StartFunction I Module FvwmAuto 1 -menter enter_handler# Local variables:# mode: outline-minor# outline-regexp: "#\\{64\\}\n# "# outline-heading-end-regexp: "\\.\n"# End: