| 文件: | libstroke-0.5.1fvwm.tar.gz | 大小: | 170KB | 下载: | 下载 |
|
I use the following excerpt in my .fvwm2rc file to define strokes.
Remember to unbind any mouse buttons from doing menus on the button(s) that
you choose for strokes! (The repeated bindings are for similar-looking
strokes that we want to all map to the same action.) Note, the context and
mod fields currently have no effect.
# Strokes
# num button context mod. action
Stroke 14789 2 A N Exec exec xlock -mode blank&
Stroke 258 2 A N Exec exec xterm&
Stroke 563214789 2 A N Exec exec exmh&
Stroke 53214789 2 A N Exec exec exmh&
Stroke 5321478 2 A N Exec exec exmh&
Stroke 5214789 2 A N Exec exec exmh&
Stroke 521478 2 A N Exec exec exmh&
Stroke 5321478 2 A N Exec exec exmh&
Stroke 453214789 2 A N Exec exec exmh&
Stroke 45321478 2 A N Exec exec exmh&
Stroke 4563214789 2 A N Exec exec exmh&
Stroke 456321478 2 A N Exec exec exmh&
Stroke 456214789 2 A N Exec exec exmh&
Stroke 45621478 2 A N Exec exec exmh&
Stroke 7415963 2 A N Exec exec netscape&
Stroke 74148963 2 A N Exec exec netscape&
Stroke 74158963 2 A N Exec exec netscape&
Stroke 7418963 2 A N Exec exec netscape&
Stroke 741236987 2 A N Destroy
Stroke 1478963 2 A N Popup "Apps"
Stroke 74123 2 A N Module "winlist" FvwmWinList transient
Stroke 74159 2 A N Move
Stroke 741569 2 A N Move
Stroke 741259 2 A N Move
Stroke 7412569 2 A N Move
Stroke 7415369 2 A N Move
Stroke 852 2 A N Menu "Apps" Nop
My full .fvwm2rc file (yes, a mess, but I'm working on it...
# The correct order for inserting configurations is:
# 1. Colors
# 2. Assorted configuration paramters such as ClickToFocus, or MWMBorders
# 3. Path setup (ModulePath, PixmapPath, IconPath)
# 4. Style settings, including the default style Style "*" ...
# 5. InitFunction and ResetFunction definitions.
# 6. Other Functions. Functions cannot be forward referenced from
# other functions, but they can be backward referenced.
# 7. Menus definitions. Same caveats about forward referencing
# 8. Key and Mouse Bindings.
# 9. Module options.
# The order of steps 5, 6, and 7 is not critical, as long as there are
# no forward references to functions or menus.
# If you get it wrong, the most common problem is that color or font settings
# are ignored
###########################################################################
# set up the colors
#
# StdForeColor Black
# StdBackColor LightSkyBlue
# HiForeColor yellow
# HiBackColor PeachPuff1
# PagerBackColor BlanchedAlmond
#Set the foreground and background color for selected windows
HilightColor Black Red
############################################################################
# Now the fonts - one for menus, another for window titles, another for icons
#Font -adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*
#!Font -*-times-medium-i-*-*-*-120-*-*-*-*-*-* (new command=MenuStyle)
WindowFont -adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*
#IconFont -adobe-helvetica-medium-r-*-*-11-*-*-*-*-*-*-*
IconFont fixed
###########################################################################
# Set up the major operating modes
#
######################## FOCUS STUFF ##############################
# Set windows to auto-raise after 750 milliseconds if you like it.
# Autoraise can sometimes obscure pop-up windows. Performance is now
# similar to olvwm's auto-raise feature.
AddToFunc "InitFunction" "I" Module FvwmAuto 1500
+ "I" Module FvwmPager 0 3
######################## ICON STUFF ##############################
# Auto Place Icons is a nice feature....
# This creates two icon boxes, one on the left side, then one on the
# bottom. Leaves room in the upper left for my clock and xbiff,
# room on the bottom for the Pager.
#need to make this better...
Style "*" IconBox -70 1 -1 -140
######################## MWM EMULATION #######################
#
# My feeling is that everyone should use MWMDecorHints and MWMFunctionHints,
# since some applications depend on having the window manager respect them
# MWMFunction hints parses the function information in the MOTIF_WM_HINTS
# property, and prohibits use of these functions on the window. Appropriate
# portions of the window decorations are removed.
Style "*" MWMFunctions
# MWM is kinda picky about what can be done to transients, and it was keeping
# me from iconifying some windows that I like to iconify, so here's an
# over-ride that will allow me to do the operation, even tough the menu
# item is shaded out.
Style "*" HintOverride
# MWMDecor hints parses the decoration information in the MOTIF_WM_HINTS
# property, and removes these decoratons from the window. This does not affect
# the functions that can be performed via the menus.
Style "*" MWMDecor
#Set the foreground, background and stipple color and font for menus
MenuStyle Black grey SlateGrey -*-times-medium-i-*-*-*-120-*-*-*-*-*-* mwm
# Maximize button does mwm-inversion thingy
Style "*" MWMButtons
######################## MISCELLANEOUS STUFF #######################
# OpaqueMove has a number (N) attached to it (default 5).
# if the window occupies less than N% of the screen,
# then opaque move is used. 0 <= N <= 100
OpaqueMoveSize 100
# flip by whole pages on the edge of the screen.
EdgeScroll 100 100
# A modest delay before flipping pages seems to be nice...
# I thresh in a 50 pixel Move-resistance too, just so people
# can try it out.
EdgeResistance 750 50
######################## WINDOW PLACEMENT #######################
# RandomPlacement prevents user interaction while placing windows:
Style "*" RandomPlacement
# SmartPlacement makes new windows pop-up in blank regions of screen
# if possible, or falls back to random or interactive placement.
Style "*" SmartPlacement
# With SmartPlacement, windows will normally place themselves over icons.
# Uncomment this to change that.
#Style "*" StubbornPlacement
# NoPPosition instructs fvwm to ignore the PPosition field in window
# geometry hints. Emacs annoyingly sets PPosition to (0,0)!
#Style "*" NoPPosition
######################## DECORATIONS #######################
# If you want decorated transient windows, uncomment this:
Style "*" DecorateTransient
###########################################################################
# Set up the virtual desktop and pager
#set the desk top size in units of physical screen size
DeskTopSize 2x2
##########################################################################
# Module path and paths to the icons
#
# ModulePath is a colon-separated list, just like regular unix PATH
# CONFIGURE
# Sun
#ModulePath /home/shay/e/willey/pub/lib/X11/fvwm2/
#PixmapPath /home/shay/e/willey/pub/lib/X11/icons/pixmap
#IconPath /home/shay/e/willey/pub/lib/X11/icons/bitmap
# NetBSD
ModulePath /usr/local/lib/X11/fvwm2
PixmapPath /usr/local/share/X11/pixmap
IconPath /usr/local/share/X11/bitmap
# Linux
#ModulePath /usr/X11R6/lib/X11/fvwm
#PixmapPath /usr/local/share/X11/pixmap
#IconPath /usr/local/share/X11/bitmap
# HP
#ModulePath /mgusers/grimm/c/willey/pub/bin/
#PixmapPath /mgusers/grimm/c/willey/pub/icons/
#IconPath /mgusers/grimm/c/willey/pub/icons/
############################################################################
# Set the decoration styles and window options
# Order is important!!!!
# If compatible styles are set for a single window in multiple Style
# commands, then the styles are ORed together. If conflicting styles
# are set, the last one specified is used.
# These commands should command before any menus or functions are defined,
# and before the internal pager is started.
# change the default width.
Style "*" BorderWidth 5, HandleWidth 5, Color Black/#60a0c0,Icon unknown1.xpm
Style "Fvwm*" NoTitle, NoHandles, Sticky, WindowListSkip,BorderWidth 0
Style "Fvwm Pager" StaysOnTop
Style "FvwmPager" StaysOnTop
#Style "FvwmBanner" StaysOnTop
#Style "FvwmFileMgr" Title, Handles, Icon folder2.xpm
# Make sure that these windows get icons.
#Style "FvwmFileManagerWindow" NoTitle, NoHandles, Icon
#Style "Garbage" Title, Handles, Icon
Style "FvwmButtons" NoTitle, NoHandles, Sticky, WindowListSkip,BorderWidth 0
Style "*lock" NoTitle, NoHandles, Sticky, WindowListSkip
Style "xbiff" NoTitle, Sticky, WindowListSkip
#Style "Maker" StartsOnDesk 1
#Style "matlab" StartsOnDesk 3
#Style "signal" StartsOnDesk 3
#Style "rxvt" Icon term.xpm
Style "*term" Icon xterm.xpm, Color black/grey
#Style "Appointment" Icon datebook.xpm, NoButton 2, NoButton 4
Style "xcalc" Icon xcalc.xpm, NoButton 2
Style "xbiff" Icon mail1.xpm, NoButton 2
#Style "xmh" Icon mail1.xpm, StartsOnDesk 2, NoButton 2
Style "xman" Icon xman.xpm
Style "xvgr" Icon graphs.xpm
Style "matlab" Icon math4.xpm
Style "xmag" Icon mag_glass.xpm
Style "xgraph" Icon graphs.xpm
Style "FvwmButtons" Icon toolbox.xpm
Style "console" Sticky
# Change the Maximize and iconify buttons to up and down triangles.
ButtonStyle 2 4 50x35@1 65x65@0 35x65@0 50x35@1
ButtonStyle 4 4 50x65@1 35x35@1 65x35@1 50x65@0
#############################################################################
# Stuff to do at start-up
#AddToFunc "InitFunction" "I" Module FvwmButtons
# Exec "I" exec xterm -geometry 80x64+0+0 &
# Wait "I" xterm
# Desk "I" 0 2
# Exec "I" exec xterm -geometry +0+0 &
# Wait "I" xterm
AddToFunc "InitFunction" "I" Desk 0 0
AddToFunc "RestartFunction" "I" Module FvwmAuto 1500
+ "I" Module FvwmPager 0 3
############################################################################
# Now define some handy complex functions
# This one moves and then raises the window if you drag the mouse,
# only raises the window if you click, or does a RaiseLower if you double
# click
AddToFunc "Move-or-Raise" "M" Move
+ "M" Raise
+ "C" Raise
+ "D" RaiseLower
# This one maximizes vertically if you click (leaving room for the GoodStuff bar at the
# bottom, or does a full maximization if you double click, or a true full vertical
# maximization if you just hold the mouse button down.
AddToFunc "maximize_func" "M" Maximize 0 100
+ "C" Maximize 0 80
+ "D" Maximize 100 100
# This one moves and then lowers the window if you drag the mouse,
# only lowers the window if you click, or does a RaiseLower if you double
# click
AddToFunc "Move-or-Lower" "M" Move
+ "M" Lower
+ "C" Lower
+ "D" RaiseLower
# This one moves or (de)iconifies:
AddToFunc "Move-or-Iconify" "M" Move
+ "D" Iconify
# This one resizes and then raises the window if you drag the mouse,
# only raises the window if you click, or does a RaiseLower if you double
# click
AddToFunc "Resize-or-Raise" "M" Resize
+ "M" Raise
+ "C" Raise
+ "D" RaiseLower
# This is provided as a hint only.
# Move to a known page on the desktop, then start an application in a
# known location. Could also switch to a known desktop, I guess
#Function "abs_coord"
# GoToPage "Immediate" 1,1
# Exec "Immediate" exec xcalc -geometry +100+100&
#EndFunction
##############################################################################
#now define the menus - defer bindings until later
# This menu is invoked as a sub-menu - it allows you to quit,
# restart, or switch to another WM.
AddToMenu "Quit-Verify" "Really Quit Fvwm?" Title
+ "Yes, Really Quit" Quit
+ "Restart fvwm2" Restart fvwm2
+ "Start fvwm" Restart fvwm
+ "Start twm" Restart twm
# Provides a list of modules to fire off
AddToMenu "Module-Popup" "Modules" Title
+ "FvwmButtons" Module FvwmButtons
+ "Clean-Up" Module FvwmClean
+ "Identify" Module FvwmIdent
+ "SaveDesktop" Module FvwmSave
+ "Debug" Module FvwmDebug
+ "Pager" Module FvwmPager 0 3
+ "FvwmWinList" Module FvwmWinList
# This defines the most common window operations
AddToMenu "Window-Ops" "Window Ops" Title
+ "Move" Function Move-or-Raise
+ "Resize" Function Resize-or-Raise
+ "Raise" Raise
+ "Lower" Lower
+ "(De)Iconify" Iconify
+ "(Un)Stick" Stick
+ "(Un)Maximize" Function maximize_func
+ "" Nop
+ "Destroy" Destroy
+ "Close" Close
+ "" Nop
+ "Refresh Screen" Refresh
# This menu will fire up some very common utilities
AddToMenu "Apps" "Apps" Title
+ "Top" Exec exec xterm -T Top -n Top -e top &
+ "Calculator" Exec exec xcalc &
+ "Xman" Exec exec xman &
+ "Xrn" Exec exec xrn &
+ "exmh" Exec exec exmh &
+ "xv" Exec exec xv &
+ "xph" Exec exec xph &
+ "irc" Exec exec xterm -T irc -n irc -e screen irc &
+ "netscape" Exec exec netscape -install&
+ "" Nop
+ "Modules" Popup Module-Popup
+ "" Nop
+ "Exit Fvwm" Popup Quit-Verify
+ "" Nop
+ "Window Ops" Popup Window-Ops
# A trimmed down version of "Window Ops", good for binding to decorations
AddToMenu "Window "Move" Function Move-or-Raise
+ "Resize" Function Resize-or-Raise
+ "Raise" Raise
+ "Lower" Lower
+ "Iconify" Iconify
+ "(Un)Stick" Stick
+ "" Nop
+ "Destroy" Destroy
+ "Close" Close
+ "" Nop
+ "ScrollBar" Module FvwmScroll 2 2
#############################################################################
# One more complex function - couldn't be defined earlier because it used
# pop-up menus
#
# This creates a motif-ish sticky menu for the title-bar window-ops
# pop-up
# Menu acts like normal twm menu if you just hold the button down,
# but if you click instead, the menu stays up, motif style
AddToFunc "window_ops_func" "C" PopUp Window Ops2
+ "M" PopUp Window Ops2
# Motif would add:
# I'll add it too, it can be mighty handy.
+ "D" Close
##############################################################################
# This defines the mouse bindings
# First, for the mouse in the root window
# Button 1 gives the Utilities menu
# Button 2 gives the Window Ops menu
# Button 3 gives the WindowList (like TwmWindows)
# I use the AnyModifier (A) option for the modifier field, so you can hold down
# any shift-control-whatever combination you want!
# Button Context Modifi Function
#Mouse 1 R A Menu "Hosts" Nop
#Mouse 2 R A Menu "Apps" Nop
#Mouse 3 R A Module "winlist" FvwmWinList transient
# Now the title bar buttons
# Any button in the left title-bar button gives the window ops menu
# Any button in the right title-bar button Iconifies the window
# Any button in the rightmost title-bar button maximizes
# Note the use of "Mouse 0" for AnyButton.
# Button Context Modifi Function
Mouse 0 1 A Function "window_ops_func"
Mouse 0 2 A Function "maximize_func"
Mouse 0 4 A Iconify
# Now the rest of the frame
# Here I invoke my complex functions for Move-or-lower, Move-or-raise,
# and Resize-or-Raise.
# Button 1 in the corner pieces, with any modifiers, gives resize or raise
Mouse 1 FS A Function "Resize-or-Raise"
# Button 1 in the title, sides, or icon, w/ any modifiers, gives move or raise
Mouse 1 T A Function "Move-or-Raise"
# Button 1 in an icons gives move for a drag, de-iconify for a double-click,
# nothing for a single click
# Button 2 in an icon, w/ any modifiers, gives de-iconify
Mouse 1 I A Function "Move-or-Iconify"
Mouse 2 I A Iconify
# Button 2 in the corners, sides, or title-bar gives the window ops menu
Mouse 2 FST A Function "window_ops_func"
# Button 3 anywhere in the decoration (except the title-bar buttons)
# does a raise-lower
Mouse 3 TSIF A RaiseLower
# Button 3 in the window, with the Modifier-1 key (usually alt or diamond)
# gives Raise-Lower. Used to use control here, but that interferes with xterm
Mouse 3 W M RaiseLower
############################################################################
# Now some keyboard shortcuts.
# Arrow Keys
# press arrow + control anywhere, and scroll by 1 page
Key Left A C Scroll -100 0
Key Right A C Scroll +100 +0
Key Up A C Scroll +0 -100
Key Down A C Scroll +0 +100
# press arrow + meta key, and scroll by 1/10 of a page
Key Left A M Scroll -10 +0
Key Right A M Scroll +10 +0
Key Up A M Scroll +0 -10
Key Down A M Scroll +0 +10
# press shift arrow + control anywhere, and move the pointer by 1% of a page
Key Left A SC CursorMove -1 0
Key Right A SC CursorMove +1 +0
Key Up A SC CursorMove +0 -1
Key Down A SC CursorMove +0 +1
# press shift arrow + meta key, and move the pointer by 1/10 of a page
Key Left A SM CursorMove -10 +0
Key Right A SM CursorMove +10 +0
Key Up A SM CursorMove +0 -10
Key Down A SM CursorMove +0 +10
# Keyboard accelerators
Key F1 A N Raise
Key F2 A N Lower
Key F3 A N Iconify
Key F4 A N Exec "xlock" xlock -mode blank&
#Key F1 A M Popup "Utilities"
#Key F1 A M Popup "Utilities"
#Key F2 A M Popup "Window Ops"
#Key F3 A M Module "WindowList" FvwmWinList
#Key F4 A M Iconify
#Key F5 A M Move
#Key F6 A M Resize
#Key F7 A M CirculateUp
#Key F8 A M CirculateDown
# Strokes
# num button context mod. action
Stroke 14789 2 A N Exec exec xlock -mode blank&
Stroke 258 2 A N Exec exec xterm&
Stroke 563214789 2 A N Exec exec exmh&
Stroke 53214789 2 A N Exec exec exmh&
Stroke 5321478 2 A N Exec exec exmh&
Stroke 5214789 2 A N Exec exec exmh&
Stroke 521478 2 A N Exec exec exmh&
Stroke 5321478 2 A N Exec exec exmh&
Stroke 453214789 2 A N Exec exec exmh&
Stroke 45321478 2 A N Exec exec exmh&
Stroke 4563214789 2 A N Exec exec exmh&
Stroke 456321478 2 A N Exec exec exmh&
Stroke 456214789 2 A N Exec exec exmh&
Stroke 45621478 2 A N Exec exec exmh&
Stroke 7415963 2 A N Exec exec netscape&
Stroke 74148963 2 A N Exec exec netscape&
Stroke 74158963 2 A N Exec exec netscape&
Stroke 7418963 2 A N Exec exec netscape&
Stroke 741236987 2 A N Destroy
Stroke 1478963 2 A N Popup "Apps"
Stroke 74123 2 A N Module "winlist" FvwmWinList transient
Stroke 74159 2 A N Move
Stroke 741569 2 A N Move
Stroke 741259 2 A N Move
Stroke 7412569 2 A N Move
Stroke 7415369 2 A N Move
Stroke 852 2 A N Menu "Apps" Nop
#Page Up/Dapge Down keys are used to scroll by one desktop page
# in any context, press page up/down + control
# in root context, just pressing page up/down is OK
#
# I prefer the non-wrapping scroll. These are for example purposes only
Key Next A C Scroll 100000 0
Key Next R N Scroll 100000 0
Key Prior A C Scroll -100000 0
Key Prior R N Scroll -100000 0
############################################################################
############################################################################
#Definitions used by the modules
# not needed due to Strokes interface
####################### button-bar ################################
## Colors
#*FvwmButtonsFore Black
#*FvwmButtonsBack Grey
#
## Font
#*FvwmButtonsFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
## Geometry - really likes to pick its own size, but giving a position is OK
#
## Linux 1024
## Sun 1151
## NetBSD,HP 1279
##*FvwmButtonsGeometry =1024x62+0+706
##*FvwmButtonsGeometry =1151x62+0+838
#*FvwmButtonsGeometry =1279x62+0+962
#
## Layout: specify rows or columns, not both
#*FvwmButtonsRows 1
#
## Define the buttons to use.....
#
## xterm or rxvts on remote machines can be done like this
## Output re-direction is csh style, not sh style
## You will want to substitute your own hosts here!
#
#*FvwmButtons xterm xterm.xpm Exec "XTerm" xterm &
#*FvwmButtons kennedy xterm.xpm Exec "kennedy" xterm -T kennedy -e rlogin kennedy.ecn.purdue.edu -l willey&
#*FvwmButtons keymaster xterm.xpm Exec "keymaster" xterm -T keymaster -e ssh keymaster.etla.net &
#*FvwmButtons screen xterm.xpm Exec "screen" xterm -T screen -e screen&
#*FvwmButtons en xterm.xpm Exec "en" xterm -T en -e rlogin en.ecn.purdue.edu -l willey&
#*FvwmButtons expert xterm.xpm Exec "expert" xterm -T expert -e rlogin expert.cc.purdue.edu -l willeyma&
#*FvwmButtons netscape mosaic.xpm Exec "Netscape" netscape -install&
#*FvwmButtons exmh mail.xpm Exec "exmh" exmh&
#
#*FvwmButtons Kill target.xpm Destroy
#! *GoodStuff Paging clamp.xpm TogglePage (TogglePage not in fvwm2)
##*GoodStuff - biff.xpm Swallow "xbiff" xbiff -bg Grey -geometry -1500-1500
#*FvwmButtons - biff.xpm Swallow "xbiff" Exec xbiff -bg Grey -geometry -1500-1500 -file /var/mail/ecnarch
##*FvwmButtons(4x4) - whatever Swallow Exec "FvwmPager" Module FvwmPager 0 3
##*FvwmButtons - whatever Swallow Module FvwmPager 0 3
# Available, but not wanted now...
######################### No Clutter ########################################
## I only wrote NoClutter as a simple test case, but maybe some big sites like
## universities really have usage problems (too many open windows)....
## Time delays are in seconds.
#*FvwmNoClutter 3600 Iconify 1
##*FvwmNoClutter 86400 Delete
##*FvwmNoCLutter 172800 Destroy
########################### Window-Identifier ###############################
## Just choose colors and a fonts
#*FvwmIdentBack MidnightBlue
#*FvwmIdentFore Yellow
#*FvwmIdentFont -adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*
########################### Pager #########################################
*FvwmPagerBack Grey
*FvwmPagerFore Blue
*FvwmPagerFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
*FvwmPagerHilight Yellow
*FvwmPagerGeometry -1-1
*FvwmPagerLabel 0 page 0
*FvwmPagerLabel 1 page 1
*FvwmPagerLabel 2 page 2
*FvwmPagerLabel 3 page 3
*FvwmPagerSmallFont 5x8
##########################FvwmWinList##################################
*FvwmWinListBack Grey
*FvwmWinListFore Black
*FvwmWinListFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
*FvwmWinListAction Click1 Iconify -1,Focus
*FvwmWinListAction Click2 Iconify
*FvwmWinListAction Click3 Module "FvwmIdent" FvwmIdent
*FvwmWinListUseSkipList
*FvwmWinListGeometry +0-1