Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ____________________________
- # ( _________________________)
- # ) (__ _ _ _ _
- # ( __)( \/ )( \/\/ )/\/\
- # ) ( \ / \ // \
- # (___) \/ \/\/(_/\/\_) 3
- #
- # +-------------------------------+
- # | $HOME/.fvwm/config |
- # +-------------------------------+
- #
- # This config file is organized as follows:
- #
- # 1. Variables
- # 2. Functions
- # 3. Desktops & Pages
- # 4. Windows & Focus Styles
- # 5. Mouse & Key Bindings
- # 5a. Mouse Bindings
- # 5b. Key Bindings
- # 6. Menus
- # 7. Colors & Decors
- # 8. Modules
- # 9. Read additional files
- #####################################################################
- # +---------------------+
- # | 1. == VARIABLES == |
- # +---------------------+
- #
- # InfoStoreAdd can be used to store variable data internal to fvwm.
- # The variable can then be used in the configuration as $[infostore.name].
- # You can also use environment variables but for data internal to fvwm
- # use InfoStore variables instead.
- #
- InfoStoreAdd terminal "xterm"
- InfoStoreAdd browser "firefox"
- InfoStoreAdd mail "$[infostore.terminal] -e mutt"
- InfoStoreAdd editor "$[infostore.terminal] -e vim"
- InfoStoreAdd file_manager "pcmanfm"
- InfoStoreAdd launchcmd "rofi -show-icons -show drun"
- InfoStoreAdd runcmd "rofi -show-icons -show run"
- # Set ImagePath so Fvwm can look for custom images and icons.
- ImagePath $[FVWM_USERDIR]/icons:$[FVWM_USERDIR]/icons;.png:+
- # +---------------------+
- # | 2. == FUNCTIONS == |
- # +---------------------+
- #
- # Fvwm can use custom functions for various tasks.
- # The syntax for defining a function named FunctionName is:
- #################################################
- # DestroyFunc FunctionName #
- # AddToFunc FunctionName #
- # + I [Action to do Immediately] #
- # + C [Action to do on a Mouse Click] #
- # + D [Action to do on a Mouse Double Click] #
- # + H [Action to do on a Mouse Hold] #
- # + M [Action to do on a Mouse Motion] #
- #################################################
- # Function: StartFunction
- #
- # The start function is run right after fvwm is done reading
- # the config file. This function runs after each restart
- # so using Test (Init) or Test (Restart) can further control
- # actions that are run during the first time run (Init) or
- # actions that are run after a restart.
- DestroyFunc StartFunction
- AddToFunc StartFunction
- # Start a tmux session with h-split panes in a maximized window
- # + I Test (Init) TmuxSplitH
- # Set the wallpaper
- + I Test (Init) Exec exec nitrogen --restore
- # Function: TmuxSplitH
- #
- # Launch a tmux window that is already horizontally split in half
- DestroyFunc TmuxSplitH
- AddToFunc TmuxSplitH
- + I Exec exec $[infostore.terminal] -n "tmux" -T "tmux" \
- -e "tmux new-session\; split -h"
- + I Wait tmux
- + I Current Maximize
- # Function: CloseWindow
- #
- # Same as Close, but also warps the pointer to the title center of the
- # previous window on current desk.
- DestroyFunc CloseWindow
- AddToFunc CloseWindow
- + I Close
- + I Prev (CurrentDesk) WarpToWindow 50 2
- # Function : CenterWindow
- #
- # Easily center your window without any hardcoded screen height and width
- DestroyFunc CenterWindow
- AddToFunc CenterWindow
- + I ThisWindow PipeRead "echo AnimatedMove \
- $(( $[vp.width]/2-$[w.width]/2 ))p \
- $(( $[vp.height]/2-$[w.height]/2 ))p"
- # Function: MaximizeOrMove
- #
- # Double-click on a window's titlebar to maximize the window
- # Drag it around with a left click to move it.
- # Also raises the window.
- DestroyFunc MaximizeOrMove
- AddToFunc MaximizeOrMove
- + I Iconify off
- + I Raise
- + D Maximize
- + M Move
- # Function: AltMove
- #
- # Easily move a window around when pressing Alt and left-click hold
- # anywhere inside it. Also raises the window.
- DestroyFunc AltMove
- AddToFunc AltMove
- + I Iconify off
- + I Raise
- + M Move
- # Function: AltResize
- #
- # Easily start resizing a window when pressing Alt and right-click
- # hold anywhere inside it. Also raises the window.DestroyFunc AltResize
- AddToFunc AltResize
- + I Iconify off
- + I Raise
- + M Resize warptoborder automatic
- # Function: WindowList
- #
- # Let's extend built-in WindowList function, so that
- # the cursor warps to the title center of the new focused window
- AddToFunc WindowListFunc
- + I WarpToWindow !raise 50 2
- # Function: ViewManPage $0
- #
- # This function loads the man page $0 in a terminal
- # and is used with the help menu.
- DestroyFunc ViewManPage
- AddToFunc ViewManPage
- + I Exec exec $[infostore.terminal] -g 80x40 \
- -T "Manual Page - $0" -e "man "$0""
- # Function: WindowOps
- #
- DestroyFunc WindowOps
- AddToFunc WindowOps
- + I WarpToWindow 11 9
- + I Silent Menu MenuWindowOps
- # +---------------------------+
- # | 3. == DESKTOPS & PAGES == |
- # +---------------------------+
- #
- # Fvwm has both Virtual Desktops and Pages. Each Desktop is built from
- # a grid of Pages. The following sets the name of four Desktops and then
- # divides each Desktop into a 2x2 grid of Pages that are positioned as
- #
- # +---+---+
- # | | |
- # +---+---+
- # | | |
- # +---+---+
- #
- DesktopName 0 WorkDesktopName 1 Browser
- DesktopName 2 Chat
- DesktopName 3 Misc
- DesktopSize 2x2
- # Disable edge scrolling.
- EdgeResistance 450
- EdgeThickness -1
- Style * EdgeMoveDelay 200, EdgeMoveResistance 50
- # EwmhBaseStruts [screen name] [left] [right] [top] [bottom]
- # Reserves space along the edge(s) of the Screen that will not
- # be covered when maximizing or placing windows.
- EwmhBaseStruts screen $[monitor.primary] 20 20 20 20
- Style * EWMHDonateIcon
- # +----------------------------------+
- # | 4. == WINDOWS & FOCUS STYLES== |
- # +----------------------------------+
- #
- # Mouse and Cursor styles
- ClickTime 300
- MoveThreshold 3
- Style * SloppyFocus
- # Default Font
- DefaultFont "xft:Sans:Bold:size=14:antialias=True"
- # Make new windows grab focus and give up
- # focus to another window upon closing.
- Style * FPGrabFocus, FPReleaseFocus
- # Set position placement for new windows
- Style * MinOverlapPlacement
- # Have Mwm-like move/resize feedback window
- Emulate Mwm
- # Configure transient windows
- Style * DontRaiseTransient, DontLowerTransient
- Style * DecorateTransient, !FPGrabFocusTransient
- # Make WindowShade "smoother" with clear animation
- Style * WindowShadeScrolls, WindowShadeBusy, WindowShadeSteps 60 # Sets all windows to OpaqueMove (vs a wired frame) and windows will
- # snap to each other and the edge of the screen.
- OpaqueMoveSize unlimited
- Style * ResizeOpaque, SnapAttraction 10 SameType ScreenAll
- # Ignore Numlock and other modifiers for bindings
- # See http://fvwm.org/documentation/faq/#why-do-numlock-capslock-and-scrolllock-interfere
- with-clicktofocus-andor-my-mouse-bindings
- IgnoreModifiers L25
- # Decor Styles
- Style * BorderWidth 5, HandleWidth 6, MwmButtons, FvwmBorder, DepressableBorder
- # Icon styles
- Style * IconOverride, IconSize 32 32
- # Application and module-specific Styles
- Style XTerm FixedPSize, ResizeHintOverride, MiniIcon 32x32/gant/terminal.png
- Style FvwmConsole FixedPSize, ResizeHintOverride, \
- MiniIcon 32x32/gant/terminal-special.png
- Style htop InitialMapCommand Maximize
- Style Pcmanfm EWMHMiniIconOverride, MiniIcon 32x32/gant/file-manager.png
- Style chromium EWMHMiniIconOverride, MiniIcon 32x32/gant/www.png
- Style firefox EWMHMiniIconOverride, MiniIcon 32x32/custom/firefox.png
- Style vlc EWMHMiniIconOverride, MiniIcon 32x32/custom/vlc.png
- Style Lutris PositionPlacement Center
- Style Discord StartsOnDesk 2, PositionPlacement Center
- Style KeePassXC StartsOnDesk 3, SkipMapping, PositionPlacement Center
- Style transmission-gtk StartsOnDesk 3, PositionPlacement Center
- Style "FvwmPager" Sticky, WindowListSkip, NoHandles
- Style "ConfirmQuit" !Title, PositionPlacement Center,\
- WindowListSkip, Layer 6
- # == Geometry Window ==
- # This is the window that shows geometry when moving/resizing windows,
- # so it's nice to have it big and clear for legibility.
- # Changes the default font - it's used for geometry window and overriden
- # everywhere else.
- DefaultFont "xft:Inconsolata:size=19:antialias=true"
- # Uncomment to hide geometry window for move action
- #HideGeometryWindow Move#
- # Window Font (used in title bars).
- WindowFont "xft:Inconsolata:size=19:antialias=true"
- # +----------------------------------+
- # | 5. == MOUSE & KEY BINDINGS == |
- # +----------------------------------+
- #
- # Mouse and Key bindings
- #
- # Contexts:
- # R = Root Window rrrrrrrrrrrrrrrrrrrrrr
- # W = Application Window rIrrrr<---------^rrrrr
- # F = Frame Corners rrrrrr[13TTTT642]rrrrr
- # S = Frame Sides rIrrrr[wwwwwwwww]rrrrr
- # T = Title Bar rrrrrr[wwwwwwwww]rrrrr
- # I = Icon rIrrrrv_________>rrrrr
- # rrrrrrrrrrrrrrrrrrrrrr
- #
- # Numbers are buttons: [1 3 5 7 9 TTTTT 0 8 6 4 2]
- #
- # Modifiers: (A)ny, (C)ontrol, (S)hift, (M)eta, (N)othing
- #
- # Format: Key <X> <Context> <Modifier> <Action>
- # Mouse <X> <Context> <Modifier> <Action>
- #
- # Silent suppresses any errors (such as keyboards with no Menu key).
- #
- #
- # +-------------------------+
- # | 5a. == KEY BINDINGS == |
- # +-------------------------+
- # Super + R to open the Root Menu.
- Silent Key R A 4 Menu MenuFvwmRoot
- # Alt-Tab to cycle through open windows.
- Silent Key Tab A M WindowList (CurrentDesk) Root c c NoDeskSort, NoGeometry,\
- NoNumInDeskTitle, CurrentAtEnd, SelectOnRelease Alt_L
- # Super + W to open WindowOps menu on a window
- Key W TW 4 Silent WindowOps
- # Super + Q to close active window.Key Q A 4 Silent CloseWindow
- # Super + M/F/C/S to toggle Maximize/Fullscreen/Center/Shade on a window
- Key M A 4 Silent Maximize
- Key F A 4 Silent Maximize fullscreen
- Key C A 4 Silent CenterWindow
- Key S A 4 Silent WindowShade
- # Super + 1/2/3/4 to go to desktop 1/2/3/4.
- Key 1 A 4 GotoDesk 0 0
- Key 2 A 4 GotoDesk 0 1
- Key 3 A 4 GotoDesk 0 2
- Key 4 A 4 GotoDesk 0 3
- # Super + Shift + 1/2/3/4 to move focused window to desktop 1/2/3/4.
- Key 1 A 4S Silent MoveToDesk 0 0
- Key 2 A 4S Silent MoveToDesk 0 1
- Key 3 A 4S Silent MoveToDesk 0 2
- Key 4 A 4S Silent MoveToDesk 0 3
- # Super + Enter to open infostored terminal.
- # Super + Shift+ Enter to launch maximized tmux window \
- inside infostored terminal with hsplit.
- Key Return A 4 Exec exec $[infostore.terminal]
- Key Return A 4S TmuxSplitH
- # Super + D to open infostored application launcher (eg. dmenu or rofi)
- Key D A 4 Exec exec $[infostore.launchcmd]
- # Super + Shift+ D to open infostored command runner (eg. dmenu or rofi)
- Key D A 4S Exec exec $[infostore.runcmd]
- # +---------------------------+
- # | 5b. == MOUSE BINDINGS == |
- # +---------------------------+
- # Window Buttons: [1 3 5 7 9 TTTTT 0 8 6 4 2]
- # 1 - Open the WindowOps menu.
- # 2 - Close on single click, Destory on double click.
- # 4 - Maximize (right/middle button will only maximize vertical/horizontal)
- # 6 - Iconify (minimize)
- #
- #
- # TitleBar: Click to Raise, Move, Double Click to Maximize
- # Mouse Wheel Up/Down to WindowShade On/Off# Borders: Click to raise, Move to Resize
- # Root Window: Right Click - Main Menu
- # Middle Click - Window List Menu
- # Right click TitleBar/Borders for WindowOps Menu
- #
- # RMB on root window to open the RootMenu
- Mouse 3 R N Menu MenuFvwmRoot
- Mouse 1 R N Nop
- # Alt + LMB anywhere on a window to begin a move operation
- Mouse 1 WT M AltMove
- # Alt + RMB anywhere on a window to begin a resize operation.
- # Best practice is to place cursor far away from window's center,
- # near a border or corner you want to resize the window to/from.
- Mouse 3 WT M AltResize
- # Alt + Middle MB anywhere on a window to Close it
- Mouse 2 WT M Silent CloseWindow
- # Double click on a window's title-bar to toggle Maximize
- Mouse 1 T N MaximizeOrMove
- # Right click on a window's title-bar to open the WindowOps menu
- Mouse 3 T N WindowOps
- # +-----------------+
- # | 6. == MENUS == |
- # +-----------------+
- #
- #MenuStyle * MenuColorset 5, ActiveColorset 6, GreyedColorset 7, TitleColorset 8
- MenuStyle * PopupImmediately, PopupOffset 0
- MenuStyle * HilightBack, HilightTitleBack, SeparatorsLong
- MenuStyle * TrianglesSolid, TrianglesUseFore
- MenuStyle * ItemFormat "%|%3.1i%5.3p%5.3l%5l%5r%5.3>%|"
- MenuStyle * Font "xft:Inconsolata:size=19:antialias=True"
- # Root Menu
- #
- # The root menu will PopUp with a click in the root window
- DestroyMenu MenuFvwmRoot
- AddToMenu MenuFvwmRoot "Root Menu" Title
- + "&1.Terminal%32x32/gant/terminal.png%" Exec exec $[infostore.terminal]
- + "&2.Browser%32x32/gant/www.png%" Exec exec $[infostore.browser]+ "&3.File Manager%32x32/gant/file-manager.png%" Exec exec $[infostore.file_manager]
- + "" Nop
- + "&4.FvwmConsole%32x32/gant/terminal-special.png%" Module FvwmConsole -terminal xterm
- + "&5.$[gt.Man Pages]%32x32/gant/help.png%" Popup MenuFvwmManPages
- + "" Nop
- + "&6.$[gt.Refresh]%32x32/gant/refresh.png%" Refresh
- + "&7.$[gt.Restart]%32x32/gant/restart.png%" Restart
- + "&8.$[gt.Quit]%32x32/gant/quit.png%" Module FvwmScript FvwmScript-ConfirmQuit
- # Window Operations Menus
- #
- DestroyMenu MenuWindowOps
- AddToMenu MenuWindowOps
- + "$[gt.Move]" Move
- + "$[gt.Resize]" Resize
- + "$[gt.(De)Iconify]" Iconify
- + "$[gt.(Un)Maximize]" Maximize
- + "$[gt.(Un)Shade]" WindowShade
- + "$[gt.(Un)Stick]" Stick
- + "" Nop
- + "$[gt.Close Window]" CloseWindow
- #DestroyMenu MenuIconOps
- #AddToMenu MenuIconOps
- #+ "$[gt.(De)Iconify]%icons/win/iconify.png%" Iconify
- #+ "$[gt.(Un)Maximize]%icons/win/max.png%" Maximize
- #+ "$[gt.(Un)Shade]%icons/win/shade.png%" WindowShade
- #+ "$[gt.(Un)Sticky]%icons/win/sticky.png%" Stick
- #+ "$[gt.(No)TitleBar]%icons/win/title.png%" Pick (CirculateHit) ToggleTitle
- #+ "$[gt.Send To]%icons/win/sendto.png%" Popup MenuSendTo
- #+ "" Nop
- #+ "$[gt.Close]%icons/win/close.png%" CloseWindow
- #+ "$[gt.Destroy]%icons/win/destroy.png%" Destroy
- #+ "" Nop
- #+ "$[gt.Raise]%icons/win/raise.png%" Raise
- #+ "$[gt.Lower]%icons/win/lower.png%" Lower
- #+ "" Nop
- #+ "$[gt.Stays On Top]%icons/win/top.png%" Pick (CirculateHit) Layer 0 6
- #+ "$[gt.Stays Put]%icons/win/stays.png%" Pick (CirculateHit) Layer 0 4
- #+ "$[gt.Stays On Bottom]%icons/win/bottom.png%" Pick (CirculateHit) Layer 0 2
- #+ "" Nop
- #+ "$[gt.Identify]%icons/info.png%" Module FvwmIdent
- #DestroyMenu MenuSendTo#AddToMenu MenuSendTo
- #+ "$[gt.Current]" MoveToCurrent
- #+ "$[gt.Page]" PopUp MenuSendToPage
- #+ "$[gt.Desk]" PopUp MenuSendToDesk
- #
- #DestroyMenu MenuSendToDesk
- #AddToMenu MenuSendToDesk
- #+ "$[gt.Desk] 0" MoveToDesk 0 0
- #+ "$[gt.Desk] 1" MoveToDesk 0 1
- #+ "$[gt.Desk] 2" MoveToDesk 0 2
- #+ "$[gt.Desk] 3" MoveToDesk 0 3
- #DestroyMenu MenuSendToPage
- #AddToMenu MenuSendToPage
- #+ "$[gt.Page] (0,0)" MoveToPage 0 0
- #+ "$[gt.Page] (0,1)" MoveToPage 0 1
- #+ "$[gt.Page] (1,0)" MoveToPage 1 0
- #+ "$[gt.Page] (1,1)" MoveToPage 1 1
- # Fvwm Man Pages (Help) Menu
- DestroyMenu MenuFvwmManPages
- AddToMenu MenuFvwmManPages "Help" Title
- + "fvwm3" ViewManPage fvwm3
- + "fvwm3all" ViewManPage fvwm3all
- + "FvwmAnimate" ViewManPage FvwmAnimate
- + "FvwmAuto" ViewManPage FvwmAuto
- + "FvwmBacker" ViewManPage FvwmBacker
- + "FvwmButtons" ViewManPage FvwmButtons
- + "FvwmCommand" ViewManPage FvwmCommand
- + "FvwmConsole" ViewManPage FvwmConsole
- + "FvwmEvent" ViewManPage FvwmEvent
- + "FvwmIconMan" ViewManPage FvwmIconMan
- + "FvwmIdent" ViewManPage FvwmIdent
- + "FvwmPager" ViewManPage FvwmPager
- + "FvwmPerl" ViewManPage FvwmPerl
- + "FvwmRearrange" ViewManPage FvwmRearrange
- + "FvwmScript" ViewManPage FvwmScript
- + "" Nop
- + "fvwm-root" ViewManPage fvwm-root
- + "fvwm-menu-desktop" ViewManPage fvwm-menu-desktop
- + "fvwm-menu-directory" ViewManPage fvwm-menu-directory
- + "fvwm-menu-xlock" ViewManPage fvwm-menu-xlock
- + "fvwm-config" ViewManPage fvwm-config
Advertisement
Add Comment
Please, Sign In to add comment