.fvwm/config
author Oleksandr Gavenko <gavenkoa@gmail.com>
Wed, 04 Feb 2009 22:43:43 +0200
branchfvwm
changeset 394 53907fe3aa2b
parent 392 023384b00d95
child 395 db04a32cc3eb
permissions -rw-r--r--
Read generated update-menu "/Debian" menu.

# -*- mode: fvwm; fill-column: 90 -*-

############################
# Set Environment variables.
############################

SetEnv fvwm_home $[HOME]/.fvwm
SetEnv fvwm_img  $[FVWM_USERDIR]/images
SetEnv fvwm_icon $[FVWM_USERDIR]/icons
SetEnv screenshot_home $[HOME]/.screenshot

#####################
# Set the image path.
#####################

ImagePath $[fvwm_icon];.xpm:$[fvwm_img]

# #################
# Virtual Desktops.
# #################

DesktopSize 3x3
DesktopName 0 Main
DesktopName 1 Work
DesktopName 2 Games
# Percentage of a page to scroll when the cursor hits the edge of a page.
# With 0 0 I cann'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 150  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

# #########################
# Mouse and Focus Behavior.
# #########################

ClickTime 350
MoveThreshold 3
Style "*" SloppyFocus, MouseFocusClickRaises

#################
# Program Styles.
#################

Style "*"          Icon app/x-32x32.xpm, \
                   MiniIcon app/x-flex-16x16.xpm
Style "XTerm"      Icon app/terminal-16x16.xpm, \
                   MiniIcon app/terminal-16x16.xpm
Style "rxvt"       Icon app/terminal-16x16.xpm, \
                   MiniIcon app/terminal-16x16.xpm
Style "mc-*"       Icon app/mc-16x16.xpm, \
                   MiniIcon app/mc-16x16.xpm

# ############
# FvwmTaskBar.
# ############

Style "FvwmTaskBar" NoTitle, !Handles, !Borders, Sticky, WindowListSkip, CirculateSkip, StaysOnBottom, FixedPosition, FixedSize, !Iconifiable

##########################################
# Screenshot Functions (uses ImageMagick).
##########################################

DestroyFunc FvwmWindowScreenshot
AddToFunc   FvwmWindowScreenshot
+ I Exec import -window $[w.id] -quality 100 -silent \
         "$[screenshot_home]/$[w.class]-`date +%F[%R]`.jpg"

DestroyFunc FvwmDesktopScreenshot
AddToFunc   FvwmDesktopScreenshot
+ I Exec sleep 2; import -window root -quality 100 -silent \
         "$[screenshot_home]/Desktop-`date +%F-[%H:%M:%S]`.jpg"

DestroyFunc FvwmScreenshot
AddToFunc   FvwmScreenshot
+ I Exec import -quality 100 -silent \
         "$[screenshot_home]/App-`date +%F-[%H:%M:%S]`.jpg"

##################
# Basic Functions.
##################

# 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')

DestroyFunc FvwmDeleteOrDestroy
AddToFunc   FvwmDeleteOrDestroy
+ H Nop
+ M Nop
+ C Delete
+ D Destroy

DestroyFunc FvwmIconifyOrShade
AddToFunc   FvwmIconifyOrShade
+ C Iconify
+ D WindowShade

DestroyFunc FvwmMaximize
AddToFunc   FvwmMaximize
+ H Nop
+ M Nop
+ C Maximize $0 $1

DestroyFunc FvwmMoveOrIconify
AddToFunc   FvwmMoveOrIconify
+ I Raise
+ M Move
+ D Iconify

# ##############
# Mouse binding.
# ##############

# 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

Mouse 1 R A Menu Utilities Nop

# Setup title-bar button actions.
Mouse 1 1 A FvwmDeleteOrDestroy
Mouse 1 3 A FvwmIconifyOrShade
Mouse 1 5 A FvwmMaximize 100 100
Mouse 2 5 A FvwmMaximize 100 0
Mouse 3 5 A FvwmMaximize 0 100
Mouse 1 TI A FvwmMoveOrIconify

# Move windows by right mouse button (pressing anywhere in a window’s border
# except the title-bar buttons).
Mouse 3 FST A FvwmMoveOrIconify

# ############
# Key binding.
# ############

# Key [(window)] Keyname Context Modifiers Function
# See Keyname on /usr/include/X11/keysymdef.h, without the XK_ prefix.

Key F1 A M Menu MenuFvwmRoot Root c c
Key Super_L W CSM Delete

# Used by WindowList
DestroyFunc WindowListFunc
AddToFunc WindowListFunc
+ I Iconify off
+ I FlipFocus
+ I Raise
# Place mouse pointer in center of window.
+ I WarpToWindow 50 50

# Prevent show long title.
SetEnv fvwm_winlist_width 60
# Define switch between aps.
Key     Tab A M WindowList Root c c NoDeskSort, MaxLabelWidth $[fvwm_winlist_width], SelectOnRelease Meta_L
Key Super_L A N WindowList Root c c NoDeskSort, MaxLabelWidth $[fvwm_winlist_width]
Key F12     A A Next Focus

# Close window on Alt+F4 (send SIGHUP).
Key F4 A M Delete

# Make screenshot.
Key Print A N  FvwmScreenshot
Key Print A S  FvwmDesktopScreenshot

###############
# Window Decor.
###############

DestroyDecor MyDecor
AddToDecor   MyDecor
+ TitleStyle LeftJustified Height 18
+ ButtonStyle 1 ActiveUp Vector 4 30x30@3 60x60@3 60x30@4 30x60@3 -- Flat
+ ButtonStyle 1 ActiveDown Vector 4 30x30@3 60x60@3 60x30@4 30x60@3 -- 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@3 60x60@3 60x50@3 30x50@3 30x60@3 -- 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@3 30x60@3 60x60@3 60x30@3 30x30@3 30x35@3 60x35@3 -- Flat
+ ButtonStyle 5 Inactive Vector 7 30x30@3 30x60@3 60x60@3 60x30@3 30x30@3 30x35@3 60x35@3 -- Flat

################
# Window Styles.
################

Style "*" UseDecor MyDecor
Style "*" BorderWidth 6, HandleWidth 6
Style "*" MWMBorder

# #####
# Menu.
# #####

Read $[fvwm_home]/menudefs.hook

AddToMenu MenuMy Media Title
+ "Peoplenet"     Exec  xterm -e /usr/bin/pon
+ VLC             Exec  vlc
+ Stardict        Exec  stardict
+ xkill           Exec  xkill

# Use interactive bash mode to read profile (~/.bashrc) to override default
# value of PS1.
AddToMenu Utilities Utilities Title
+ Xterm           Exec  xterm -e bash -i
+ Mc              Exec  xterm -fn "-misc-fixed-medium-r-*-*-18-*-*-*-*-*-iso10646-1" \
                              -name mc-secondary -geometry 120x42 -e bash -i -c "mc -x"
+ Emacs           Exec  emacs

+ debian          Popup "/Debian"
+ my              Popup MenuMy
+ fvwm            Popup MenuFvwmRoot

########################
# Window Operation Menu.
########################

# From "FVWM Beginners Guide" by Jaimos F Skriletz.

DestroyMenu FvwmWindowOpsMenu
AddToMenu   FvwmWindowOpsMenu "Window Operations" Title
+ "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
+ "Close%menu/window-close.xpm%"  Close
+ "Delete%menu/window-delete.xpm%"  Delete
+ "Destroy%menu/window-destroy.xpm%"  Destroy
+ "" 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" FvwmDesktopScreenshot
+ "" Nop
+ "Identify%menu/window-identify.xpm%"  Module FvwmIdent

Mouse 3 R A Menu FvwmWindowOpsMenu

# ##########
# FvwmPager.
# ##########

# No any button on pager.
Style "FvwmPager" !Button 1, !Button 3, !Button 5, \
         StaysOnTop, Sticky, FixedPosition, FixedSize, !Iconifiable, \
         WindowListSkip, CirculateSkip

SetEnv FvwmPager_Inactive rgb:c0/c0/c0
SetEnv FvwmPager_Active rgb:ef/df/bdc

DestroyModuleConfig FvwmPager: *
*FvwmPager: Back $[FvwmPager_Inactive]
*FvwmPager: BalloonBack $[FvwmPager_Active]
*FvwmPager: Hilight  $[FvwmPager_Active]
*FvwmPager: Geometry 80x300-0+0
*FvwmPager: WindowColors $[FvwmPager_Inactive] $[FvwmPager_Inactive] $[FvwmPager_Active] $[FvwmPager_Active]
*FvwmPager: Font "xft:Sans:Bold:pixelsize=12:minspace=True:antialias=True"
*FvwmPager: Balloons All
*FvwmPager: BalloonFont "-Misc-Fixed-Medium-R-Normal-*-13-*-*-*-*-*-ISO10646-1"
*FvwmPager: MiniIcons
*FvwmPager: UseSkipList
*FvwmPager: Rows 3
*FvwmPager: Columns 1

# #########
# FvwmAuto.
# #########

# The autohiding functions.
# From http://fvwm.org/documentation/faq/#toc_7.17
# See question "Autohiding FvwmButtons or other windows".
AddToFunc autohide
+ I ThisWindow ($0) Deschedule $[w.id]
+ I ThisWindow ($0) KeepRc ThisWindow (shaded) WindowShade off
+ I TestRc (!Match) All ($0, !shaded) autohide_hide $1 $2

AddToFunc autohide_hide
+ I Schedule $0 $[w.id] WindowShade $1
+ I Schedule $0 $[w.id] Deschedule $[w.id]

# Add the windows you want to autohide
AddToFunc enter_handler
+ I autohide FvwmPager 500 N

####################
# Startup functions.
####################

# Define whare place autoloaded progs.
# StartsOnPage [desk [x y]]
Style "mc-main"         StartsOnPage 0 1 0, SkipMapping
Style "stardict"        StartsOnPage 2 1 2, SkipMapping

# Only once.
AddToFunc InitFunction
+ I Exec xterm -fn "-misc-fixed-medium-r-*-*-18-*-*-*-*-*-iso10646-1" \
               -name mc-main -geometry 120x42 -e bash -i -c "mc -x"
+ I Exec stardict

# After all restart.
AddToFunc RestartFunction
+ I Nop

# First and after all restart.
# All fvwm modules exit after restart fvwm, so you must put they there.
AddToFunc StartFunction
+ I Module FvwmPager 0 2
+ I Module FvwmAuto 1 -menter enter_handler
# Add next to load desktop image (must be .xpm or .png)
# + I Exec fvwm-root -r ~/tmp/MagicItemComp2_1280x1024.png