|
|
发表于 2004-8-29 16:59:21
|
显示全部楼层
不好意思贴出我修改的.fvwm2rc文件,很多都是别人写的。呵呵
原文地址
http://www.fvwm.org/screenshots/ ... esk-1152x864/fvwmrc
原搞贴图:
http://www.fvwm.org/screenshots/ ... x864/screenshot.jpg
两天来的修改初步结果:(保留了原作者的注释,虽然我删除了很多我无法使用或者不知如何使用的东东。)
- ###################
- # This is how my fvwm2rc looked on 22/01/2004, using fvwm-2.5.8 on Gentoo Linux.
- #
- # Screenshots: [1]http://dev.gentoo.org/~taviso/screenshots/
- # Wallpaper: [2]http://digitalblasphemy.com/
- #
- # -Tavis Ormandy (taviso@gentoo.org)
- #########################################
- #####
- # Set the directories to look in for Image files.
- #################
- ImagePath ${HOME}/icons:/usr/share/icons:+
- #####
- # You can set simple options like this, using variables.
- #
- # If you need something more complex, read the man pages for FvwmCPP, FvwmM4 or FvwmPerl.
- #################
- SetEnv fvwm_video_path $[HOME]/media/video
- SetEnv fvwm_video_exec xine
- SetEnv fvwm_audio_path $[HOME]/mp3
- SetEnv fvwm_audio_exec xmms
- SetEnv fvwm_image_path $[HOME]/pic
- SetEnv fvwm_image_exec xv
- SetEnv fvwm_rom_path $[HOME]/stuff/zsnes
- SetEnv fvwm_rom_exec zsnes
- SetEnv fvwm_wallpaper $[HOME]/01.png
- #####
- # If you use Thumbnails, how big would you like the Icons to be?
- #
- # Try one of these, from tiny to large: 32, 64, 96, 128
- #
- # Note that the aspect ratio is maintained, so tall and thin windows may get larger icons,
- # but you can change that if it annoys you.
- #################
- SetEnv fvwm_icon_size 96
- #####
- # You can automatically move the viewport into adjacent pages when the pointer
- # hits the screen edge, but I dont like this.
- # This EdgeResistance disables it, but still allows me to move windows over onto adjacent pages.
- #
- # EdgeThickness disables edge scrolling and EdgeCommand, which I never use.
- #################
- EdgeResistance 1000 20
- EdgeThickness 0
- #####
- # You will want to disable this if you are running fvwm over a network, but otherwise this
- # handy setting stops NumLock/ScrollLock from interfering with bindings.
- #
- # If you disable this, I guarantee it will catch you out and have you scratching your
- # head at some point :)
- #
- # [3]http://www.fvwm.org/documentation/faq/#5.5
- #################
- IgnoreModifiers L25
- #####
- # You can use EwmhBaseStruts to stop Maximised windows from obscuring TaskBars/ButtonBars
- # or anything else you always want to be visible.
- #
- # This Setting makes sure my ButtonBar on the left and taskbar along the bottom is always
- # visible.
- #################
- EwmhBaseStruts 0 0 0 20
- ######
- # Fvwm uses a default ClickTime of 150ms, which is way too short for me.
- # A Click that lasts <= ClickTime is considered a `Click` in functions,
- # > ClickTime is a `Hold`.
- #################
- ClickTime 250
- #####
- # Use 9 pages per desktop, arranged in a square, like this:
- #
- # +-----+-----+-----+
- # | | | |
- # +-----+-----+-----+
- # | | | |
- # +-----+-----+-----+
- # | | | |
- # +-----+-----+-----+
- #
- #################
- DeskTopSize 3x3
- ######
- # Use an arrow rather than the `X` cursor on the root window.
- #################
- CursorStyle root top_left_arrow
- #####
- # OpaqueMoveSize allows you to stop Large windows from being moved opaquely,
- # I like the effect, and have Cycles to burn, so all windows can use it.
- #
- # SnapAttraction lets nearby windows snap together, or snap to edges so that they
- # are easier to align on your desktop, The default is off, if you set it too large
- # it's annoying as hell, 3 pixels is just right.
- #################
- OpaqueMoveSize -1
- SnapAttraction 3
- ######
- # Ksh has my favourite shell syntax, so use it if it exists.
- #################
- #Test (f /bin/ksh) ExecUseShell /bin/ksh
- ######
- # Menu Settings.
- #
- # * PopupOffset allows you to control where submenus will appear, and
- # whether they should overlap or not.
- # * This menu uses a translucent Colorset, and Hilighted items are light
- # blue with a single pixel border.
- # * The Menu will look flat, with a 2 pixel border.
- # * I changed the default ItemFormat to be a little more spacious.
- #
- # AutomaticHotKeys generates your HotKeys (Keys you can press when a menu opens to
- # jump straight to an item) for you, you can write your own also, or disable them.
- # I've gone off HotKeys recently, so it's disabled for now.
- #################
- Colorset 0 fg black, bg grey, sh black, hi black, Translucent #c6cfce 90
- Colorset 1 fg black, bg #9cb2ce, hi #dcdcdc, sh #dcdcdc
- #Colorset 23 RootTransparent, fg rgb:ff/ff/c4, bg darkcyan
- Colorset 23 fg white, bg #c6c3c6, sh black, hi black, RootTransparent
- MenuStyle * Hilight3DThin, PopupOffset -2 100
- #MenuStyle * Font "Shadow=1 1 SE:xft:AR PL KaitiM GB:style=Roman:size=11"
- #MenuStyle * Font "StringEncoding=gbk-0:Shadow=0 0 SE:xft:AR PL KaitiM GB:size=11:encoding=iso10646-1"
- MenuStyle * MenuColorset 23, HilightBack, ActiveColorset 1
- MenuStyle * BorderWidth 2, TitleUnderlines1, SeparatorsLong, TrianglesSolid, Animation
- MenuStyle * ItemFormat "%.2|%.5i%.5l%.5i%2.3>%2|"
- # MenuStyle * AutomaticHotKeys
- ######
- # Use colormaps according to Focus, rather than where the Mouse is.
- #################
- ColormapFocus FollowsFocus
- ######
- # Default window Styles.
- #
- # I like single pixel borders, which look cleaner and simpler that the default 3d borders.
- #
- # It can be a little tricky to grab the handles, but I usually use a Key Binding for that
- # anyway, you can always make the handles stick out a bit more if you use them more than I do.
- #
- # SloppyFocus is the one true Focus policy :) (focus follows mouse, except on root)
- #
- # If I click in a window, I like it to be raised.
- #
- # GrabFocus is terrible, windows are always stealing focus and keystrokes end up in the wrong
- # windows and you lose your train of thought, etc. So turn it off here, and back on for windows
- # that play nice with it.
- #
- # Set up an IconBox (an area that Windows jump to by default when Iconified) in the bottom left
- #
- # Syntax Reminder:
- #
- # IconBox [screen scr-spec] l t r b
- #
- # Fvwm offers several placement policies, which decide where new windows should appear, I've
- # found that SmartPlacement makes a decent guess at where the windows should be, but there are
- # plenty more to choose from.
- #################
- #Style * Font "xft:Bitstream Vera Sans Mono:style=Roman:size=11"
- #Style * Font "StringEncoding=gbk-0:Shadow=0 0 SE:xft:SimSun:size=11:encoding=gbk-0", BorderWidth 1, HandleWidth 1
- Style * BorderWidth 1, HandleWidth 1
- Style * Color #f6f6f6/black, HilightBack black, HilightFore white
- Style * MWMFunctions, MWMDecor, HintOverride, DecorateTransient, NoPPosition
- Style * IconBox 20 100 100 -15, SloppyFocus, MouseFocusClickRaises
- Style * SmartPlacement, WindowShadeSteps 20, ResizeOpaque
- Style * Button 1, Button 2, Button 4, Button 6, GrabFocus
- Style * NoIconTitle
- # Comment out these lines if you don't like Icons to have Titles.
- Colorset 11 fg black, bg white, NoShape, RootTransparent Buffer
- Style * IconTitle, IconTitleColorset 11, HilightIconTitleColorset 11, IconTitleRelief 0, IndexedIconName
- #Style * IconFont "StringEncoding=gbk-0:Shadow=0 0 SE:xft:tahoma,AR PL KaitiM GB:size=11:encoding=iso10646-1"
- # This is another nice Placement Policy, which tries to avoid obscuring existing windows,
- # you can set penalties on certain window types so some are less likely to be obscured than
- # others. Check the manpage for even more Placement Policies.
- #Style * MinOverlapPercentPlacement
- #Style * MinOverlapPercentPlacementPenalties 2 5 1 2 0.5 50
- Style * MinOverlapPlacement
- BorderStyle Active Solid black -- NoInset HiddenHandles
- BorderStyle Inactive Solid black -- NoInset HiddenHandles
- #####
- # My Vectors look like this
- #
- # +----------------------------------------------------------+
- # | . _ # X |
- # +----------------------------------------------------------+
- # | 1 6 4 2 |
- # | |
- # |
- #
- # When the Buttons are ActiveDown (Pressed), they move 5% to the right
- # and 5% down, which gives the impression of being pressed. I've also used
- # a vector to seperate the buttons out on active windows.
- #
- # Active Window TitleBar has a Vertical Gradient of White (at the top) to
- # Black at the bottom where the buttons are, and a gradient of Blue to black over
- # the title, using 16 shades (one for each pixel, so looks like a nice, smooth transition).
- #
- # Inactive uses a tinted transparent colorset, with white text and buttons.
- ##################
- Colorset 7 fg black, bg white, NoShape, RootTransparent Buffer, Tint #5a8ade 60
- Colorset 8 fg black, bg white, NoShape, RootTransparent Buffer, Tint #f6f6f6 20
- DestroyDecor DefaultDecor
- AddToDecor DefaultDecor
- + TitleStyle LeftJustified Height 16
- + TitleStyle InActive ( Colorset 7 -- Flat ) \
- Active ( HGradient 61 1 #5a8ade 50 #000000 -- Flat )
- + ButtonStyle All InActive ( Colorset 8 -- Flat )
- + ButtonStyle All Active ( Colorset 8 -- Flat )
- + AddButtonStyle 4 ActiveUp Vector 9 30x30@2 30x60@2 60x60@2 60x30@2 \
- 30x30@2 30x35@2 60x35@2 0x99@4 0x0@2 -- Flat
- + AddButtonStyle 4 Inactive Vector 7 30x30@3 30x60@3 60x60@3 60x30@3 \
- 30x30@3 30x35@3 60x35@3 -- Flat
- + AddButtonStyle 4 ActiveDown Vector 10 35x35@2 35x65@2 65x65@2 65x35@2 \
- 35x35@2 35x40@2 65x40@2 0x99@4 0x0@2 99x0@2 -- Flat
- + AddButtonStyle 1 Inactive Vector 4 44x44@3 44x45@3 45x45@3 44x44@3 -- Flat
- + AddButtonStyle 1 ActiveUp Vector 6 44x44@2 44x45@2 45x45@2 44x44@2 99x99@4 \
- 99x0@2 -- Flat
- + AddButtonStyle 1 ActiveDown Vector 8 49x49@2 49x50@2 50x50@2 49x49@2 99x90@4 \
- 99x0@2 99x0@2 0x0@2-- Flat
- + AddButtonStyle 6 ActiveUp Vector 7 30x60@2 60x60@2 60x50@2 30x50@2 30x60@2 0x99@4 \
- 0x0@2 -- Flat
- + AddButtonStyle 6 Inactive Vector 5 30x60@3 60x60@3 60x50@3 30x50@3 30x60@3 -- Flat
- + AddButtonStyle 6 ActiveDown Vector 8 35x65@2 65x65@2 65x60@2 35x60@2 35x65@2 0x99@4 \
- 0x0@2 99x0@2 -- Flat
- + AddButtonStyle 2 ActiveUp Vector 6 30x30@2 60x60@2 60x30@4 30x60@2 0x99@4 \
- 0x0@2 -- Flat
- + AddButtonStyle 2 Inactive Vector 4 30x30@3 60x60@3 60x30@4 30x60@3 -- Flat
- + AddButtonStyle 2 ActiveDown Vector 7 35x35@2 65x65@2 65x35@4 35x65@2 0x99@4 \
- 0x0@2 99x0@2 -- Flat
- + ButtonStyle 1 - MwmDecorMenu
- + ButtonStyle 6 - MwmDecorMin
- + ButtonStyle 4 - MwmDecorMax
- Style * UseDecor DefaultDecor
- #####
- # Application specific Style settings
- #
- # You might be interested in the IconOverride style, which will allow you to specify
- # an Icon for an application even if it has set its own previously, This can be very
- # useful for applications that insist on setting their own icons even if it doesnt
- # fit in with your theme :)
- #################
- Style FvwmPager NoTitle, Sticky, WindowListSkip, CirculateSkipIcon, CirculateSkip
- Style FvwmPager StaysOnBottom, NoHandles, BorderWidth 1
- Style FvwmBanner NoTitle
- Style FvwmButtons NoTitle, StaysOnBottom, Sticky, WindowListSkip, CirculateSkipIcon, CirculateSkip
- Style FvwmButtons HandleWidth 2, NeverFocus, Layer 1
- Style FvwmTaskBar NoTitle, WindowListSkip, CirculateSkip, Sticky, BorderWidth 0, NoHandles, StaysOnBottom
- Style FvwmTaskBar NeverFocus, Layer 0
- #Style mlterm MiniIcon computer_x11.png
- # AutoHiding Console
- Style HiddenConsole Sticky, WindowListSkip, Notitle, StaysOnTop, NoHandles
- Style HiddenConsole WindowShadeSteps 100
- #####
- # Miscellaneous Module Settings.
- #################
- # FvwmIdent is an xwininfo replacement.
- DestroyModuleConfig FvwmIdent: *
- *FvwmIdent: Back MidnightBlue
- *FvwmIdent: Fore #f6f6f6
- *FvwmIdent: Font "xft:snap"
- # FvwmScroll swallows applications into smaller containers.
- DestroyModuleConfig FvwmScroll: *
- *FvwmScroll: Back #f6f6f6
- *FvwmScroll: Fore #f6f6f6
- # FvwmEvent can bind Commands to Events
- DestroyModuleConfig FvwmEvent: *
- # Animations are controlled by this module
- # You could also use Frame, Lines, Flip, Turn, Twist, Random and None.
- DestroyModuleConfig FvwmAnimate: *
- *FvwmAnimate: Effect Flip
- # Hit Alt+Esc to toggle FvwmProxy, which allows you to see all windows on your
- # desktop, even if they've been obscured..really cool.
- DestroyModuleConfig FvwmProxy: *
- *FvwmProxy: Font "xft:snap"
- *FvwmProxy: ProxyMove true
- Key Escape A M SendToModule FvwmProxy ShowToggle
- ####
- # First, define a StrokeFunc.
- #
- # Without this, you would have to execute all of your gestures entirely on the Root
- # Window, This lets you change the Context and have a few other Neat Features, such as
- # DrawMotion, which will draw a line as you make your Gesture (Neat!).
- #
- # There is also EchoSequence, Feedback and NotStayPressed.
- #
- # Note: EchoSequence prints sequences to STDERR.
- #################
- Mouse 3 R A StrokeFunc DrawMotion FeedBack StrokeWidth 1
- # Down, Then Up.
- Stroke 25852 0 R N Refresh
- # Directions...
- Stroke 456 0 R N GotoPage +1p 0p
- Stroke 654 0 R N GotoPage -1p 0p
- Stroke 852 0 R N GotoPage 0p -1p
- Stroke 258 0 R N GotoPage 0p +1p
- # Diagonal...
- Stroke 159 0 R N GotoPage +1p +1p
- Stroke 951 0 R N GotoPage -1p -1p
- Stroke 357 0 R N GotoPage -1p +1p
- Stroke 753 0 R N GotoPage +1p -1p
- #####
- # Quit
- #
- # Down, Then Right.
- #
- # Dont worry about running this gesture by accident,
- # you will be asked to confirm
- #################
- Stroke 14789 0 R N Module FvwmForm FvwmForm-QuitVerify
- ####
- # Up, Then Down: Close a window.
- #
- # Note that you can also enter the sequence as it appears on your
- # Numeric Keypad, by preceding the sequence with an `N`.
- #
- # The FVWM developers think of everything :)
- #################
- Stroke N25852 0 R N Pick Close
- # Start a Web Browser
- Stroke N1478963 0 R N Exec exec opera -newpage
- # Make a new Sticky Note
- Stroke N1598753 0 R N Exec exec xpad
- #####
- # Fvwm executes StartFunction when Fvwm is initialized, and at restart.
- # A Good place to start Modules.
- #
- # FvwmCommandS Allows you to run Fvwm Commands from a Terminal, like this:
- # $ FvwmCommand 'Module FvwmBanner'
- # Or any other Command.
- #
- # You can test for Initialization from within StartFunction, this is a good
- # place to set the Background or start your favourite applications.
- #################
- DestroyFunc StartFunction
- AddToFunc StartFunction
- + I Module FvwmCommandS
- + I Module FvwmAnimate
- + I Module FvwmEvent
- + I Module FvwmProxy
- + I Module FvwmTaskBar
- + I Test (Init) Exec exec fvwm-root --dither --retain-pixmap $[fvwm_wallpaper]
- #+ I Test (Restart) All (Iconic) Test (f $[HOME]/.fvwm/icon.tmp.$[w.id].png) WindowStyle IconOverride, Icon $[HOME]/.fvwm/icon.tmp.$[w.id].png
- #####
- # I Sometimes use xsm, but dont usually bother.
- #################
- #AddToFunc SessionInitFunction I Nop
- #AddToFunc SessionRestartFunction I Nop
- #####
- # ExitFunction is executed when you ask Fvwm to Quit.
- # Test (ToRestart) is true before a Restart.
- #################
- DestroyFunc ExitFunction
- AddToFunc ExitFunction
- + I Test (!ToRestart) Exec exec rm -f $[HOME]/.fvwm/icon.tmp.*
- + I Exec exec sync
- #####
- # Name: FuncFvwmFocusPolicyChange
- # Bound: MenuFvwmConfig, Focus Policy Changes.
- # Purpose: Start using a new Focus Policy.
- #
- #################
- DestroyFunc FuncFvwmFocusPolicyChange
- AddToFunc FuncFvwmFocusPolicyChange
- + I Style * $0
- + I Recapture
- #####
- # Name: PackWindowUp
- # Bound: Alt+Shift+Up When a window is active
- # Purpose: Interrogate all windows on the current page, find the window with an edge
- # closest to active window, and slide the Active window upto that edge, or
- # the Page edge, if no window is in the way.
- #
- # The Wrappers are required to look after the Context while we're testing
- # windows. Could also do it with a load of variables, but this is nicer.
- #
- # See PackWindowLeft for a description of the logic (i know it looks a little
- # cryptic).
- #
- # Sometimes terminals seem to need WindowRefresh, but 99% of the time it just
- # works, it creates a little flicker so I'll leave it out until it starts to bug
- # me.
- #
- # Windows are also Raised, you can disable this.
- #
- #################
- DestroyFunc PackWindowUp
- AddToFunc PackWindowUp
- + I SetEnv low_w 0
- + I WindowId $3 Raise
- + I All (CurrentPage !Iconic AcceptsFocus \
- !Shaded) PipeRead "test `expr $[w.y] + $[w.height]` -gt $[low_w] \
- -a `expr $[w.y] + $[w.height]` -lt $0 \
- -a \\( \\( $[w.x] -gt $1 -a $[w.x] -lt `expr $1 + $2` \\) \
- -o \\( $1 -gt $[w.x] -a $1 -lt `expr $[w.x] + $[w.width]` \\) \
- -o \\( $1 -le $[w.x] -a `expr $1 + $2` -ge `expr $[w.x] + $[w.width]` \\) \
- -o \\( $[w.x] -lt $1 -a `expr $[w.x] + $[w.width]` -gt `expr $1 + $2` \\) \
- \\) \
- && echo SetEnv low_w `expr $[w.y] + $[w.height]` \
- || echo Nop"
- + I WindowId $3 AnimatedMove keep $[low_w]p
- #+ I WindowId $3 RefreshWindow
- AddToFunc PackWrapperUp I NoWindow PackWindowUp $[w.y] $[w.x] $[w.width] $[w.id]
- #####
- # Name: PackWindowDown
- # Bound: Alt+Shift+Down When a window is active.
- # Purpose: See PackWindowUp.
- #
- #################
- DestroyFunc PackWindowDown
- AddToFunc PackWindowDown
- + I SetEnv high_w $[vp.height]
- + I WindowId $3 Raise
- + I All (CurrentPage !Iconic AcceptsFocus \
- !Shaded) PipeRead "test $[w.y] -lt $[high_w] \
- -a $[w.y] -gt `expr $0 + $4` \
- -a \\( \\( $[w.x] -gt $1 -a $[w.x] -lt `expr $1 + $2` \\) \
- -o \\( $1 -gt $[w.x] -a $1 -lt `expr $[w.x] + $[w.width]` \\) \
- -o \\( $1 -le $[w.x] -a `expr $1 + $2` -ge `expr $[w.x] + $[w.width]` \\) \
- -o \\( $[w.x] -lt $1 -a `expr $[w.x] + $[w.width]` -gt `expr $1 + $2` \\) \
- \\) \
- && echo SetEnv high_w $[w.y] \
- || echo Nop"
- + I PipeRead "echo WindowId $3 AnimatedMove keep `expr $[high_w] - $4`p"
- #+ I WindowId $3 RefreshWindow
- AddToFunc PackWrapperDown I NoWindow PackWindowDown $[w.y] $[w.x] $[w.width] $[w.id] $[w.height]
- #####
- # Name: PackWindowLeft
- # Bound: Alt+Shift+Left When a window is active
- # Purpose: See PackWindowUp.
- #
- # The Logic works likes this:
- # 1. Set Destination to the Left Edge
- # 2. For every window, Run these tests:
- # + Is the Window's Right edge further _Right_ than furthest edge seen yet?
- # And: + Is it's Right edge Further _Left_ than Target Windows Left edge? (ie, in the way)
- # Yes:
- # + Does the window start inside Target Window, and end below?
- # Or + Does it start above, and end inside?
- # Or + Is it the same vertical position/height/size, or start inside and end inside?
- # Or + Does it start above, and end below?
- # Yes:
- # This is the new Destination.
- # No:
- # Nop
- # No:
- # Nop
- # 3. Move to Destination.
- #
- #################
- DestroyFunc PackWindowLeft
- AddToFunc PackWindowLeft
- + I SetEnv left_w 0
- + I WindowId $3 Raise
- + I All (CurrentPage !Iconic AcceptsFocus \
- !Shaded) PipeRead "test `expr $[w.x] + $[w.width]` -gt $[left_w] \
- -a `expr $[w.x] + $[w.width]` -lt $1 \
- -a \\( \\( $[w.y] -gt $0 -a $[w.y] -lt `expr $0 + $4` \\) \
- -o \\( $[w.y] -lt $0 -a `expr $[w.y] + $[w.height]` -gt $0 \\) \
- -o \\( $[w.y] -ge $0 -a `expr $[w.y] + $[w.height]` -le `expr $0 + $4` \\) \
- -o \\( $[w.y] -lt $0 -a `expr $[w.y] + $[w.height]` -gt `expr $0 + $4` \\) \
- \\) \
- && echo SetEnv left_w `expr $[w.x] + $[w.width]` \
- || echo Nop"
- + I WindowId $3 AnimatedMove $[left_w]p keep
- #+ I WindowId $3 RefreshWindow
- AddToFunc PackWrapperLeft I NoWindow PackWindowLeft $[w.y] $[w.x] $[w.width] $[w.id] $[w.height]
- DestroyFunc PackWindowRight
- AddToFunc PackWindowRight
- + I SetEnv right_w $[vp.width]
- + I WindowId $3 Raise
- + I All (CurrentPage !Iconic AcceptsFocus \
- !Shaded) PipeRead "test $[w.x] -lt $[right_w] \
- -a $[w.x] -gt `expr $1 + $2` \
- -a \\( \\( $[w.y] -gt $0 -a $[w.y] -lt `expr $0 + $4` \\) \
- -o \\( $[w.y] -lt $0 -a `expr $[w.y] + $[w.height]` -gt $0 \\) \
- -o \\( $[w.y] -ge $0 -a `expr $[w.y] + $[w.height]` -le `expr $0 + $4` \\) \
- -o \\( $[w.y] -lt $0 -a `expr $[w.y] + $[w.height]` -gt `expr $0 + $4` \\) \
- \\) \
- && echo SetEnv right_w $[w.x] \
- || echo Nop"
- + I PipeRead "echo WindowId $3 AnimatedMove `expr $[right_w] - $2`p keep"
- #+ I WindowId $3 RefreshWindow
- AddToFunc PackWrapperRight I NoWindow PackWindowRight $[w.y] $[w.x] $[w.width] $[w.id] $[w.height]
- #####
- # Name: WheelToggleShade
- # Bound: Mouse Buttons 4 and 5 (wheel up and down) on Titlebars
- # Purpose: Shade or unshade the window when the Mouse wheel is rolled up or
- # down on the Titlebar. Rolling the Wheel up calls the Function with
- # argument `True` and rolling it down uses `False`, so rolling the wheel
- # down when the window isnt shaded has no effect, which I like :)
- #
- #################
- DestroyFunc WheelToggleShade
- AddToFunc WheelToggleShade D WindowShade $0
- #####
- # Name: DestroyOnHold
- # Bound: Titlebar Button 2 (X)
- # Purpose: When clicked, Raise the window Immediately.
- # If the button is pressed and released, Close the Window. If it is pressed
- # and held, Destroy it, and issue a Beep to confirm.
- #
- # There is a 100ms delay before issuing `Close` so I have a chance to see the
- # animation when the button changes from ActiveDown to ActiveUp :).
- #
- #################
- DestroyFunc DestroyOnHold
- AddToFunc DestroyOnHold I Raise
- + C Schedule 100 Close
- + H Destroy
- + H Beep
- #####
- # Name: Thumbnail
- # Purpose: Iconify a window with a reduced screenshot of the application
- # Window, looks really cool.
- #
- # Uses FvwmEvent to remove the Icon when deiconified, you will want
- # to remove this if you use WindowStyle elsewhere.
- #
- # Thumbnailing example: [6]http://dev.gentoo.org/~taviso/step2.png
- #
- ##################
- DestroyFunc Thumbnail
- AddToFunc Thumbnail
- + I Raise
- + I PipeRead "xwd -silent -id $[w.id] | convert -scale $[fvwm_icon_size] -frame 1x1 \
- -mattecolor black -quality 0 xwd:- png:$[HOME]/.fvwm/icon.tmp.$[w.id].png \
- && echo WindowStyle IconOverride, Icon $[HOME]/.fvwm/icon.tmp.$[w.id].png, StaysOnBottom \
- || echo Nop"
- + I Iconify
- DestroyFunc DeThumbnail
- AddToFunc DeThumbnail
- + I Exec exec rm -f $HOME/.fvwm/icon.tmp.$[w.id].png
- + I DestroyWindowStyle
- # FIXME: This will destroy all Windowstyle settings.
- FvwmEvent: deiconify DeThumbnail
- # FIXME: Make this more useful.
- # XXX: This doesnt do much yet, you can play with it if you like.
- # Example: [7]http://dev.gentoo.org/~taviso/fvwm_expose.png
- DestroyFunc FvwmExpose
- AddToFunc FvwmExpose
- + I AddToMenu FvwmExposeMenu ".: e x p o s e :." Title
- + I All (!Iconic !Shaded CurrentPage AcceptsFocus)\
- PipeRead "echo Raise; \
- xwd -silent -id $[w.id] | convert -scale 128 -frame 1x1 \
- -mattecolor white -quality 0 xwd:- \
- png:$[HOME]/.fvwm/icon.exp.$[w.id].png \
- && echo AddToMenu FvwmExposeMenu \
- %$[HOME]/.fvwm/icon.exp.$[w.id].png%\\\'"$[w.name]"\\\' WindowID $[w.id] WarpToWindow 50 50 \
- && echo AddToMenu FvwmExposeMenu \\"\\" Nop \
- || Nop"
- + I Popup FvwmExposeMenu
- + I DestroyMenu FvwmExposeMenu
- + I Exec exec rm -f $[HOME]/.fvwm/icon.exp.*
- AddToFunc WindowListFunc I WarpToWindow 50 50
- #####
- # Miscellaneous Functions
- #################
- AddToFunc Move-or-Raise I Raise
- + M Move
- + D WindowShade Toggle
- AddToFunc Maximize-Func M Maximize 0 100
- + C Maximize 0 80
- + D Maximize 100 100
- AddToFunc Move-or-Iconify I Raise
- + M Move
- + D Iconify
- AddToFunc Resize-or-Raise I Raise
- + M Resize
- + D Lower
- #####
- # Mouse bindings.
- #################
- # Syntax Reminder:
- # Mouse Button Context Modifiers Function
- Mouse 1 R A Menu MenuFvwmRoot
- Mouse 4 R A Menu MenuFvwmRoot
- Mouse 5 R A Menu MenuFvwmRoot
- Mouse 2 R A WindowList
- Mouse 0 1 A Menu MenuFvwmWindowOps Nop
- Mouse 0 2 A DestroyOnHold
- Mouse 0 6 A Thumbnail
- Mouse 0 4 A Maximize
- #Mouse 4 T A WheelToggleShade True
- #Mouse 5 T A WheelToggleShade False
- Mouse 1 FS A Resize-or-Raise
- Mouse 1 T A Move-or-Raise
- Mouse 1 I A Move-or-Iconify
- Mouse 2 I A Iconify
- Mouse 2 I A Thumbnail
- Mouse 3 TSIF A RaiseLower
- Mouse 3 W M Menu Window-Ops Nop
- Mouse 2 W C Resize-or-Raise
- Mouse 1 W M Move-or-Raise
- # Reserved for Mouse Gestures (See below)
- #Mouse 3 R A -
- #####
- # Key bindings.
- #################
- Key F1 A M Exec exec mlterm
- Key F4 A M Pick Close
- Key X A 4 Pick Destroy
- Key L A 4 Exec exec xscreensaver-command --lock
- Key I A 4 All (AcceptsFocus CurrentPage !Iconic !Shaded) Thumbnail
- Key F4 A CM Quit
- Key R A CM Restart
- Key Up WTSF SM PackWrapperUp
- Key Down WTSF SM PackWrapperDown
- Key Left WTSF SM PackWrapperLeft
- Key Right WTSF SM PackWrapperRight
- ####
- # Mouse Gestures.
- #
- # Syntax reminder:
- #
- # 1 2 3
- #
- # 4 5 6
- #
- # 7 8 9
- #
- # Stroke Sequence Button Context Modifiers Function
- #
- # I use mouse gestures in Opera and Mozilla, so I've duplicated some common ones here.
- #
- # To try these out, hold down the Left mouse button and trace the pattern on the Root
- # Window, the sequence is a pattern on the grid above, so 14789 would be down then Right.
- #################
- #####
- # Menu definitions
- # Beep if theres a missing SubMenu to remind me to write it.
- #################
- DestroyMenu MenuFvwmRoot
- AddToMenu MenuFvwmRoot
- + MissingSubmenuFunction Beep
- + "终端" Exec exec mlterm
- + "" Nop
- + "网络" Popup MenuInternet
- + "文本编辑" Popup MenuEditors
- + "多媒体" Popup MenuMultimedia
- + "工具" Popup MenuUtilities
- + "开发" Popup MenuDevel
- + "游戏" Popup MenuGames
- + "Logins" Popup Menulogins
- + "" Nop
- + "FVWM选项" Popup MenuFvwmConfig
- + "Window Controls" Popup MenuFvwmWindowOps
- + "" Nop
- + "&Xkill" Pick Destroy
- + "R&efresh" Refresh
- + "&Screenshot" Exec exec scrot --quality 100 '%Y-%m-%d_$wx$h.png'
- + "&Lock Screen" Exec exec xscreensaver-command -lock
- + "" Nop
- + "退出 Fvwm" Popup MenuQuit-Verify
- DestroyMenu MenuOffice
- AddToMenu MenuOffice
- + "Acrobat Reader" Exec exec xpdf
- + "Calculator" Exec exec xcalc
- DestroyMenu MenuInternet
- AddToMenu MenuInternet
- + "浏览器" Exec exec mozilla
- + "" Nop
- + "Instant Messenger" Exec exec gaim
- + "E-Mail Client" Exec exec mozilla -mail
- DestroyMenu MenuEditors
- AddToMenu MenuEditors
- + "Vim" Exec exec vim
- + "Gedit" Exec exec gedit
- DestroyMenu MenuMultimedia
- AddToMenu MenuMultimedia
- + "xmms" Exec exec xmms
- + "Audio CD Player" Exec exec grip
- + "" Nop
- + "Xine Videos" Exec exec xine
- DestroyMenu MenuUtilities
- AddToMenu MenuUtilities
- + "文件管理器" Exec exec konqueror
- + "" Nop
- + "Maya" Exec exec Maya6.0
- + "Gimp" Exec exec gimp
- + "" Nop
- + "VMware Workstation" Exec exec vmware
- + "Nautilus File Manager" Exec exec nautilus --no-desktop
- DestroyMenu MenuDevel
- AddToMenu MenuDevel
- + "Html Editor" Exec exec mozilla
- + "Development Environment" Exec exec kdevelop3
- DestroyMenu MenuGames
- AddToMenu MenuGames
- + "Quake III Arena" Exec exec $[HOME]/q3.sh
- #####
- # I start fvwm from my ~/.xinitrc like this:
- # exec ssh-agent fvwm2
- # So if i select "Add Agent Identity" from this menu, it adds my default ssh key to ssh-agent.
- #################
- DestroyMenu MenuLogins
- AddToMenu MenuLogins
- + %telephone_out.png%"SDF Public Access UNIX System" Exec exec aterm -g \
- 102x42 -title '.: s d f :.' -e ssh tty.freeshell.org
- + %computer_network.png%"Gentoo Linux Dev Server" Exec exec aterm -g \
- 102x42 -title '.: t e r m i n a l :.' -e ssh dev.gentoo.org
- + %key2.png%"Add Agent Identity" Exec ssh-add < /dev/null || ( test -x /usr/lib/misc/ssh-askpass || xmessage "Please install net-misc/x11-ssh-askpass." )
- + "" Nop
- + %computer_x11.png%"Large Terminal Emulator" Exec exec aterm -g 102x42 -title '.: t e r m i n a l :.'
- + %computer_x11.png%"Mini Terminal Emulator" Exec exec rxvt -g 63x8 -title '.: m i n i t e r m :.' -e sh
- #####
- # You can browse directories and files with the fvwm-menu-directory
- # script included with Fvwm, its very configurable (as you might expect!),
- # and very useful.
- #
- # [5]http://www.mail-archive.com/fvwm%40hpc.uh.edu/msg05260.html
- #################
- DestroyFunc FuncFvwmMenuDirectory
- AddToFunc FuncFvwmMenuDirectory
- + I PipeRead 'case $0 in \
- $[fvwm_rom_path]*) myexec=$[fvwm_rom_exec] mypng=games_puzzles_dice.png;; \
- $[fvwm_video_path]*) myexec=$[fvwm_video_exec] mypng=film.png;; \
- $[fvwm_audio_path]*) myexec=$[fvwm_audio_exec] mypng=audio.png;; \
- $[fvwm_image_path]*) myexec=$[fvwm_image_exec] mypng=graphics_presentation_person.png;; \
- esac; \
- fvwm-menu-directory --icon-title folder_view.png --icon-file ${mypng:-file_text_view.png} \
- --icon-dir folder_paper_closed.png --dir $0 --xterm exec --exec-file ${myexec:-gvim}'
- DestroyMenu MenuQuit-Verify
- AddToMenu MenuQuit-Verify
- + "立即退出 Fvwm"%ctl_alt_f4.png% Quit
- + "Restart Fvwm..."%ctl_alt_r.png% Restart
- DestroyMenu MenuFvwmConfig
- AddToMenu MenuFvwmConfig
- + "Fvwm Modules" Popup MenuFvwmModules
- + "" Nop
- + "Configure FvwmForm..." Module FvwmForm FvwmForm-Form
- + "Configure Cursor..." Module FvwmForm FvwmForm-RootCursor
- + "Configure Screensaver..." Exec exec xscreensaver-demo
- + "Configure Mouse..." Module FvwmScript FvwmScript-PointerSetup
- + "Configure Keyboard..." Module FvwmScript FvwmScript-KeyboardSetup
- + "Configure Bell..." Module FvwmScript FvwmScript-BellSetup
- + "General Settings..." Module FvwmScript FvwmScript-BaseConfig
- #####
- # `Pick` is very handy, if it's obvious which window you're talking about,
- # The command is executed immediately within the context of that window.
- #
- # If it isnt obvious, for example, you select `Move` from the Root menu, the
- # cursor becomes a crosshair, and you can select the window you you would like
- # to apply the command to by clicking it.
- #
- # This saves a lot of work, you can use `Pick` with everything that might be
- # Called without context and only write one function/menu instead of two.
- #################
- DestroyMenu FvwmMoveMethods
- AddToMenu FvwmMoveMethods
- + "Move to Top" Pick AnimatedMove keep 0p
- + "Move to Left" Pick AnimatedMove 0p keep
- + "Move to Right" Pick PipeRead \
- "echo AnimatedMove `expr $[vp.width] - $[w.width]`p keep"
- + "Move to Bottom" Pick PipeRead \
- "echo AnimatedMove keep `expr $[vp.height] - $[w.height]`p"
- + "" Nop
- + %window.png%"Center Window" Pick PipeRead \
- "echo AnimatedMove `expr \\( $[vp.width] - $[w.width] \\) / 2`p \
- `expr \\( $[vp.height] - $[w.height] \\) / 2`p"
- + "" Nop
- + %hardware_mouse.png%"Pack Up"%alt_sft_up.png% Pick PackWrapperUp
- + %hardware_mouse.png%"Pack Left"%alt_sft_left.png% Pick PackWrapperLeft
- + %hardware_mouse.png%"Pack right"%alt_sft_right.png% Pick PackWrapperRight
- + %hardware_mouse.png%"Pack down"%alt_sft_down.png% Pick PackWrapperDown
- + "" Nop
- + %numbers_counter.png%"Move To Page" Popup MenuPageList
- + "" Nop
- + %hardware_mouse.png%"Interactive Move" Pick Move
- DestroyMenu MenuPageList
- AddToMenu MenuPageList
- + "1" Pick MoveToPage 0 0
- + "2" Pick MoveToPage 1 0
- + "3" Pick MoveToPage 2 0
- + "4" Pick MoveToPage 0 1
- + "5" Pick MoveToPage 1 1
- + "6" Pick MoveToPage 2 1
- + "7" Pick MoveToPage 0 2
- + "8" Pick MoveToPage 1 2
- + "9" Pick MoveToPage 2 2
- #####
- # WindowOps, Main window controls menu.
- #################
- DestroyMenu MenuFvwmWindowOps
- AddToMenu MenuFvwmWindowOps
- + "Resize" Pick Resize
- + "Iconify " Pick Iconify
- + "Thumbnail " Pick Thumbnail
- + "Maxmimise" Pick Maximize
- + "Move" Popup FvwmMoveMethods
- + "Shade" Pick WindowShade Toggle
- + "" Nop
- + "Stick" Pick Stick
- + "Scroll" Pick Module FvwmScroll
- + "Refresh" Pick RefreshWindow
- + "" Nop
- + "Identify" Pick Module FvwmIdent
- + "Zoom" Pick Exec exec xmag -source $[w.width]x$[w.height]+$[w.x]+$[w.y] -mag 2
- + "" Nop
- + "Close"%alt_f4.png% Pick Close
- + "Destroy"%win_x.png% Pick Destroy
- DestroyMenu MenuFvwmModules
- AddToMenu MenuFvwmModules
- + "Animation " Module FvwmAnimate
- + "Button-Bar " Module FvwmButtons
- + "Identify " Module FvwmIdent
- + "IconMan " Module FvwmIconMan
- + "Banner " Module FvwmBanner
- + "Console " Module FvwmConsole -terminal rxvt
- + "Pager " Module FvwmPager 0 1
- + "Backer " Module FvwmBacker
- + "ScrollBar " Module FvwmScroll 50 50
- + "FvwmTaskBar " Module FvwmTaskBar
- + "AutoRaise " Module FvwmAuto 200 Raise Nop
- + "WinList " Module FvwmWinList
- + "" Nop
- + "Stop Module " Popup MenuFvwmStopModule
- DestroyMenu MenuFvwmStopModule
- AddToMenu MenuFvwmStopModule
- + "Stop Button-Bar " KillModule FvwmButtons
- + "Stop IconMan " KillModule FvwmIconMan
- + "Stop Pager " KillModule FvwmPager
- + "Stop Backer " KillModule FvwmBacker
- + "Stop ScrollBar " KillModule FvwmScroll
- + "Stop FvwmTaskBar " KillModule FvwmTaskBar
- + "Stop AutoRaise " KillModule FvwmAuto
- + "Stop WinList " KillModule FvwmWinList
- #####
- # FvwmPager is probably the most advanced desktop pager ever written,
- # of course its highly configurable, has many advanced features, and can
- # be made to look very eye candy.
- #
- # You can drag the Windows around inside the Pager, pull windows from
- # other desktops out onto your current page, or drag the viewport into
- # non-standard positions.
- #
- # This pager gets swallowed into my FvwmButtons Bar. The pages are seperated
- # by solid white lines, the pager itself is tinted transparent and the colours
- # lighten as focus and the viewport changes.
- #
- # You can write titles, or draw icons into the Windows, but i prefer to use
- # the Balloons (tooltips) to find the Names.
- #
- # +-----+-----+-----+
- # | | | |
- # +-----+-----+-----+
- # | | | |
- # +-----+-----+-----+
- # | | | |
- # +-----+-----+-----+
- #
- #################
- Colorset 2 fg white, bg black, RootTransparent, Tint #b5b2ff 80
- Colorset 3 fg white, bg black, RootTransparent, Tint #eeefcf 70
- Colorset 4 fg #63656e, bg black, RootTransparent, Tint #b5b2ff 60
- Colorset 5 fg black, bg Khaki1, Plain
- Colorset 6 fg white, bg black, RootTransparent, Tint #e4e5c7 90
- DestroyModuleConfig FvwmPager: *
- *FvwmPager: Colorset * 3
- *FvwmPager: HilightColorset * 6
- *FvwmPager: WindowColorsets 4 2
- *FvwmPager: BalloonColorset * 5
- *FvwmPager: Font none
- *FvwmPager: SmallFont 5x8
- *FvwmPager: Balloons All
- *FvwmPager: BalloonFont "xft:mintsstrong"
- *FvwmPager: BalloonYOffset +2
- *FvwmPager: BalloonBorderWidth 1
- *FvwmPager: UseSkipList
- *FvwmPager: MoveThreshold 3
- *FvwmPager: SolidSeparators
- *FvwmPager: WindowLabelFormat ""
- *FvwmPager: WindowBorderWidth 1
- Colorset 10 fg black, bg #c6c3c6, RootTransparent, Tint #efebef 65
- DestroyModuleConfig FvwmButtons: *
- Colorset 11 fg white, bg #c6c3c6, sh black, hi black, RootTransparent buffer
- DestroyModuleConfig FvwmTaskBar: *
- *FvwmTaskBar: Geometry +0-0
- *FvwmTaskBar: Rows 1
- #*FvwmTaskBar: Font "xft:AR PL KaitiM GB:size=10"
- #*FvwmTaskBar: StatusFont "xft:AR PL KaitiM GB:size=10"
- #*FvwmTaskBar: SelFont "xft:AR PL KaitiM GB:size=10"
- *FvwmTaskBar: Colorset 11
- *FvwmTaskBar: AutoStick
- *FvwmTaskBar: UseSkipList
- *FvwmTaskBar: PageOnly
- *FvwmTaskBar: ShowTips
- *FvwmTaskBar: NoDefaultStartButton
- *FvwmTaskBar: NoBrightFocus
- *FvwmTaskBar: 3DFvwm
- *FvwmTaskBar: MailCheck 0
- *FvwmTaskBar: IconColorset 11
- *FvwmTaskBar: FocusColorset 11
- *FvwmTaskBar: DateFormat %Y-%m-%d
- *FvwmTaskBar: ClockFormat %H:%M %p
- *FvwmTaskBar: WindowButtonsRightMargin 124
- # References
- #
- # 1. [url]http://dev.gentoo.org/~taviso/screenshots/[/url]
- # 2. [url]http://digitalblasphemy.com/[/url]
- # 3. [url]http://www.fvwm.org/documentation/faq/#5.5[/url]
- # 4. [url]http://dev.gentoo.org/~taviso/autohide_console.png[/url]
- # 5. [url]http://www.mail-archive.com/fvwm%40hpc.uh.edu/msg05260.html[/url]
- # 6. [url]http://dev.gentoo.org/~taviso/step2.png[/url]
- # 7. [url]http://dev.gentoo.org/~taviso/fvwm_expose.png[/url]
- # 8. [url]http://www.fvwm.org/documentation/faq/#7.17[/url]
复制代码 |
|