配置文件如下
################################################################################
#
# ____________________________
# ( _________________________)
# ) (__ _ _ _ _
# ( __)( \/ )( \/\/ )/\/\
# ) ( \ / \ // \
# (___) \/ \/\/(_/\/\_) 2.5.16
#
# My personal fvwm2rc file written by Freda
# Copyright by xxxxx@xxx.xxx
#
#
################################################################################
# set imagepath to directorys we wish to use
ImagePath $[HOME]/.fvwm/icons
###########################
# Set Environment variables
###########################
SetEnv fvwm_script $[HOME]/.fvwm/script/
# use 1 viewports
DeskTopSize 1x1
DestroyFunc InitFunction
AddToFunc InitFunction
+ I Exec exec gnome-font-properties
+ I Exec exec gnome-volume-properties
DestroyFunc StartFunction
AddToFunc StartFunction
# 设置设置桌面背景
+ I Exec exec fvwm-root -r $HOME/.fvwm/icons/wallpaper/3.png
# 设置数字时钟样式
+ I Exec exec xclock -bg grey -update 1 -geometry 160x160-10+10
# 设置数字时钟样式,具体可 man xclock 和 man strftime
# + I Exec exec xclock -geometry 160x30-10+170 -d -bg grey -fg blue -strftime '%a, %d %b %G'
# 启动快捷面板
+ I Module FvwmButtons FvwmDocker
DestroyFunc ExitFunction
AddToFunc ExitFunction
+ I All (xclock) Close
+ I All (gnome-font-properties) Close
+ I All (gnome-volume-properties) Close
##################### Menus ###################
MenuStyle * MWM
MenuStyle * PopupDelayed, PopupDelay 160, Animation, TitleWarp
Menustyle * Font -adobe-times-bold-r-*-*-14-*-*-*-*-*-*-*
MenuStyle * Foreground maroon, Background grey60, Greyed grey40
DestroyMenu MenuFvwmRoot
AddToMenu MenuFvwmRoot "Freda's Menu%fvwm.xpm%" Title
+ "" Nop
+ %24x24/gnome-xterm.png%"Gnome Terminal" Exec exec gnome-terminal
+ %24x24/dial-up.png%"Dial-Up" Exec exec kinternet --plain
+ %24x24/firefox.png%"Mozilla Firefox" Exec exec firefox
+ "" Nop
+ %24x24/mycomp.png%"File Manager" Exec exec konqueror
+ %24x24/locked.png%"Lock Screen" Exec exec xlock -mode random
+ %24x24/gear.png%"Refresh Screen" Refresh
+ "" Nop
+ "Exit Fvwm%24x24/poweroff.png" Popup Quit-Verify
+ "" Nop
AddToMenu Quit-Verify
+ %24x24/refresh.png%"Restart Fvwm" Restart
+ "" Nop
+ %24x24/logout.png%"Log Out" Quit
+ "" Nop
+ %24x24/poweroff.png%"Shut Down" exec exec xterm -e su -c 'shutdown -h now'
+ %24x24/reboot.png%"Reboot" exec exec xterm -e su -c reboot
+ "" Nop
##################### Windows ######################################################
# 以“style”开头的语句,用来设置所有窗口的样式
#################################
#设置拥有焦点时的标题栏颜色设置
Style * HilightFore white, HilightBack SlateBlue
#################################
#窗口标题栏字体
# set Font for windows enviroment
Style * Font "-misc-dejavu sans-medium-r-*-*-14-*-*-*-*-*-*-*,-*-simsun-medium-r-normal-*-14-*-*-*-*-*-*-*"
################################
# 窗口按钮—— FVWM 可以给窗口加上最多10个按钮,编号分别为:1 3 5 7 9 0 8 6 4 2
# 一般窗口上一般有三个按钮, 都在右上角,注意它们的编号为:6 4 2
Style * Button 2, Button 4, Button 6
# 按钮的样式
Colorset 0 fg white, bg SlateBlue # active
#Colorset 1 fg black, bg SlateBlue
ButtonStyle All --flat
ButtonStyle All Active Colorset 0
#ButtonStyle All InActive Colorset 1
AddButtonStyle 6 Inactive Vector 5 30x60@3 60x60@3 60x50@3 30x50@3 30x60@3
AddButtonStyle 6 ActiveUp Vector 5 30x60@3 60x60@3 60x50@3 30x50@3 30x60@3
AddButtonStyle 6 ActiveDown Vector 5 35x65@3 65x65@3 65x60@3 35x60@3 35x65@3
AddButtonStyle 4 Inactive Vector 7 30x30@3 30x60@3 60x60@3 60x30@3 30x30@3 30x35@3 60x35@3
AddButtonStyle 4 ActiveUp Vector 7 30x30@3 30x60@3 60x60@3 60x30@3 30x30@3 30x35@3 60x35@3
AddButtonStyle 4 ActiveDown Vector 7 35x35@3 35x65@3 65x65@3 65x35@3 35x35@3 35x40@3 65x40@3
AddButtonStyle 2 Inactive Vector 4 30x30@3 60x60@3 60x30@4 30x60@3
AddButtonStyle 2 ActiveUp Vector 4 30x30@3 60x60@3 60x30@4 30x60@3
AddButtonStyle 2 ActiveDown Vector 4 35x35@3 65x65@3 65x35@4 35x65@3
ButtonStyle 6 - MwmDecorMin
ButtonStyle 4 - MwmDecorMax
# 窗口最小化后图标放置位置
# icons - should go to top left
Style * IconBox 30 100 100 -15, IconFill top left
# 不要图标标题
Style * NoIconTitle
# Style * IconTitle, IndexedIconName
# Style * IconTitleColorset 3, HilightIconTitleColorset 3
# Style * IconTitleRelief 0
# 应用程序替换图标
Style "matlab" Icon matlab.png, IconOverride
Style "eio" Icon ooo-writer.png, IconOverride
Style "emacs23" Icon gnome-emacs.png, IconOverride
Style * MinOverlapPercentPlacement
Style * MinOverlapPercentPlacementPenalties 2 5 1 2 0.5 50
Style * ResizeOutLine
Style * MouseFocusClickRaises
Style * FocusFollowsMouse #所有窗口,都是鼠标移进去的时候得到键盘聚焦,鼠标移出来就失去聚焦
Style * TileCascadePlacement #窗口出现的时候,先试图找一个可以放下它而不挡住其它窗口的地方,如果不行再采用层叠放置的方式
Style * DecorateTransient
Style "xclock" NoTitle, NoHandles, Sticky, NeverFocus, Layer 1, WindowListSkip, NoIcon, !Iconifiable # !Iconifiable表示不会被最小化
################################################################################
#########################
### 键盘动作的定义 Key Keyname Context Modifiers Function
#########################
# Context的定义与后面鼠标动作的解释是一致的,Context 是用来描述在什麽地方才会有用。
# R 表示是root window,也就是整个背景萤幕。
# W 表示在视窗上面。
# T 表示在Title Bar上面,也就是显示视窗标题的地方。
# S 表示在在视窗四周的边框上面。
# F 表示在视窗的四角上面。
# I 表示在Icon上面。
# A 表示在Title Bar以外的任何地方。
# 0-9的数字则是表示在Title Bar上面的按钮。它 所表示的顺序如下所示:
# 1 3 5 7 9 0 8 6 4 2
# 上面的各项可以混合使用。如"FST" 表示整个视窗的任何地方。除了Title Bar 的按钮之外。
# Modifiers 这个项目是指有无其他的组合键的配合。
# N 表示没有其他的组合键。
# C 表示CTRL键。
# S 表示SHIFT 键。
# A 表示ALT 键。
# M 表示Meta键。
# 上面各项也可以混合用,例如"CA"表示CTRL+ALT 键。"CAS" 表示CTRL+ALT+SHIFT键。
################################################################################
############ 用Alt+Tab切换窗口
IgnoreModifiers L25 # 这是忽略 CapsLock, NumLock, ScrollLuck 以避免快捷键失效。
Key Tab A M WindowList Root c c NoDeskSort
############ 键盘F1~F4绑定为启动几个主要的应用程序
# F1显示桌面
# F2打开终端
# F3打开FvwmConsole
# F4打开浏览器
Key F1 A A FuncFvwmIconifyToggle
Key F2 A A StartTerminal
# set FvwmConsole
Key F3 A A Module FvwmConsole -terminal xterm -bg gold -fg midnightblue -fn "-adobe-courier-medium-r-*-*-14-*-*-*-*-*-*-*"
Key F4 A A StartFirefox
######## 将F5绑定为重新启动Fvwm
Key F5 A A Restart
######## 设定F9开启屏保
Key F9 A A Exec exec xlock -mode random
######## 函数定义
DestroyFunc FuncFvwmIconifyTrue
AddToFunc FuncFvwmIconifyTrue
+ I All (!Iconic) State 1
+ I All (State 1) Iconify True
DestroyFunc FuncFvwmIconifFalse
AddToFunc FuncFvwmIconifyFalse
+ I All (State 1) Iconify False
DestroyFunc FuncFvwmIconifyToggle
AddToFunc FuncFvwmIconifyToggle
+ I FuncFvwmIconifyFalse
+ I All (State 1) State 1 False
+ I TestRc (NoMatch) FuncFvwmIconifyTrue
DestroyFunc StartTerminal
AddToFunc StartTerminal
+ I Exec exec gnome-terminal
DestroyFunc StartFirefox
AddToFunc StartFirefox
+ I Exec exec firefox
################################################################################
###############
## 鼠标动作的定义: Mouse Button Context Modifiers Function
###############
#Button: 1代表左键
# 2代表中键
# 3代表右键
# 0代表任何键
#Context: A:除过标题栏按钮外的任意区域
# R:代表根窗口(也就是桌面)
# T:代表标题栏
# S:代表边框
# F:代表窗口的四个角
# W:代表窗口的客户区域
# I:代表图标
# n:
# ##############################
# 1 3 5 7 9 0 8 6 4 2
# ##############################
# (0<=n<=9)窗口的标题栏上的按钮位置,靠左侧的是(1 3 5 7 9)
# 靠右侧的是(0 8 6 4 2)例如常见的MS-Windows的最小化按钮是
# 6,最大化是4,关闭是2,系统菜单是1
###################################
Mouse 1 R A Menu MenuFvwmRoot Nop
Mouse 3 R A WindowList NoGeometry
# Titlebar Buttons
Mouse 1 6 A Iconify
Mouse 1 4 A Maximize
Mouse 1 2 A Close
# window/border/icon
Mouse 1 I A DeThumbnail
Mouse 1 T A FuncMoveOrMaximize
Mouse 2 T A Function MoveOrLower
##################################
AddToFunc MoveOrLower
+ "Click" Lower
+ "Motion" Lower
+ "Motion" Move
+ "DoubleClick" Lower
#----------------------------------------------------------------------#
# 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: 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 Iconify off
+ I DestroyWindowStyle
+ I Exec exec rm -f $[HOME]/.fvwm/icon.tmp.$[w.id].png
DestroyFunc FuncMoveOrMaximize
AddToFunc FuncMoveOrMaximize
+ I Raise
+ M Move
+ D Maximize 100 100
DestroyFunc FuncDestroyOnHold
AddToFunc FuncDestroyOnHold
+ C Schedule 100 Close
+ H Destroy
+ H Beep
############################################################################
DestroyFunc StartDocker
AddToFunc StartDocker
+ I AutoHide FvwmDocker 250 500 S
DestroyFunc FvwmDockerAutoEnter
AddToFunc FvwmDockerAutoEnter
+ I AutoHide FvwmDocker 250 500 S
+ I AutoHide FvwmTaskBar 250 500 N
# ^ ^ ^ ^
# | | | |__ Shade direction (optional)
# | | |______ Hide delay
# | |__________ Show delay
# |______________________ Unique window name/resource
#----------------------------------------------------------------------#
# These functions modified from the functions provided in the fvwm FAQ.
# http://www.fvwm.org/documentation/faq/#7.17
#----------------------------------------------------------------------#
DestroyFunc AutoHide
AddToFunc AutoHide
+ I ThisWindow ($0) Deschedule $[w.id]
+ I TestRc (!Match) Deschedule -$[w.id]
+ I ThisWindow ($0) ThisWindow (shaded) AutohideShow $1 $3
+ I TestRc (!Match) All ($0, !shaded) AutohideHide $2 $3
DestroyFunc AutohideShow
AddToFunc AutohideShow
+ I Schedule $0 -$[w.id] WindowShade $1 off
+ I Schedule $0 -$[w.id] Raise
+ I Schedule $0 -$[w.id] Deschedule $[w.id]
+ I Schedule $0 -$[w.id] Deschedule -$[w.id]
DestroyFunc AutohideHide
AddToFunc AutohideHide
+ I Schedule $0 $[w.id] WindowShade $1 on
+ I Schedule $0 $[w.id] Deschedule $[w.id]
+ I Schedule $0 $[w.id] Deschedule -$[w.id]
# this one originates from ikaros configs iirc
DestroyFunc FuncDockLaunch
AddToFunc FuncDockLaunch
+ C Any ($1) Next ($1) WindowListFunc
+ C TestRc (NoMatch) Exec $0
+ H Any ($1) WindowList ($1) Rectangle +$2+$3 0 -100m CurrentAtEnd UseListSkip SortByClass NoCurrentDeskTitle
+ D Exec $0
####### =======================FvwmDocker begin=============================================
Style FvwmDocker NoTitle, Sticky, Handlewidth 0, Borderwidth 1, WindowListSkip, NoIcon, \
StaysOnBottom, WindowListSkip, CirculateSkipIcon, CirculateSkip,\
!Iconifiable, Layer 1 # !Iconifiable表示不会被最小化
#Colorset 50 fg #ffffff, bg #4584b5, hi gray, sh gray, RootTransparent buffer, IconAlpha 75, Tint #4584b5 0
#Colorset 51 fg #ffffff, bg #7f7f7f, hi gray, sh gray, RootTransparent buffer, IconAlpha 100, Tint #4584b5 0
# RootTransparent buffer 表示色彩为透明色
Colorset 50 fg #ffffff, bg #4584b5, hi gray, sh gray, IconAlpha 75, Tint #4584b5 0
Colorset 51 fg #ffffff, bg #7f7f7f, hi gray, sh gray, IconAlpha 100, Tint #4584b5 0
DestroyModuleConfig FvwmDocker: *
*FvwmDocker: Geometry -200-5
*FvwmDocker: Colorset 50
*FvwmDocker: ActiveColorset 51
*FvwmDocker: Rows 1
*FvwmDocker: Columns 9
# 设置按键深度
*FvwmDocker: Frame 0
*FvwmDocker: Padding 0 0
*FvwmDocker: (1x1, Icon 48x48/Fred.png, ActionOnPress, Action(Mouse 1) `FuncDockLaunch gnome-screenshot --delay=2 screenshot* $left $top`, `Next (screenshot*) Popup MenuWindowOptions Rectangle +$left +$top 0 -100m`)
# 终端设为gnome-terminal
*FvwmDocker: (1x1, Icon 48x48/gnome-xterm.png, ActionOnPress, Action(Mouse 1) `FuncDockLaunch gnome-terminal gnome-terminal* $left $6top`, `Next (*gnome-terminal) Popup MenuWindowOptions Rectangle +$left +$top 0 -100m`)
# firefox浏览器
*FvwmDocker: (1x1, Icon 48x48/firefox.png, ActionOnPress, Action(Mouse 1) `FuncDockLaunch firefox *firefox $left $top`, `Next (*firefox) Popup MenuWindowOptions Rectangle +$left +$top 0 -100m`)
*FvwmDocker: (1x1, Icon 48x48/gedit-icon.png, ActionOnPress, Action(Mouse 1) `FuncDockLaunch gedit *gedit $left $top`, `Next (*gedit) Popup MenuWindowOptions Rectangle +$left +$top 0 -100m`)
*FvwmDocker: (1x1, Icon 48x48/matlab.png, ActionOnPress, Action(Mouse 1) `FuncDockLaunch matlab *matlab $left $top`,`Next (*matlab) Popup MenuWindowOptions Rectangle +$left +$top 0 -100m`)
*FvwmDocker: (1x1, Icon 48x48/gimp.png, ActionOnPress, Action(Mouse 1) `FuncDockLaunch gimp gimp* $left $top`, `Next (gimp*) Popup MenuWindowOptions Rectangle +$left +$top 0 -100m`)
*FvwmDocker: (1x1, Icon 48x48/stardict.png, ActionOnPress, Action(Mouse 1) `FuncDockLaunch stardict stardict* $left $top`, `Next (stardict*) Popup MenuWindowOptions Rectangle +$left +$top 0 -100m`)
# acrobat reader阅读器
*FvwmDocker: (1x1, Icon 48x48/acroread.png, ActionOnPress, Action(Mouse 1) `FuncDockLaunch acroread acroread $left $top`, `Next (*acroread) Popup MenuWindowOptions Rectangle +$left +$top 0 -100m`)
# 上网拨号程序
*FvwmDocker: (1x1, Icon 48x48/kinternet.png, ActionOnPress, Action(Mouse 1) `FuncDockLaunch kinternet kinternet* $left $top`, `Next (kinternet*) Popup MenuWindowOptions Rectangle +$left +$top 0 -100m`)
#设置音量
*FvwmDocker: (1x1, Icon 48x48/volume.png, ActionOnPress, Action(Mouse 1) `FuncDockLaunch gnome-volume-control gnome-volume-control* $left $top`, `Next (gnome-volume-control*) Popup MenuWindowOptions Rectangle +$left +$top 0 -100m`)
*FvwmDocker: (2x1, Swallow "Time" `FvwmScript $[fvwm_script]/Time`)
########=======================FvwmDocker end===============================================
#############################################################################################