LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 14404|回复: 26

我的FVWM配置和注释

[复制链接]
发表于 2005-7-8 16:59:19 | 显示全部楼层 |阅读模式
初次接触FVWM,在参考几位大虾的作品后,自己胡搞出了一个简单的配置。
本来只愿独自陋藏。基于一下原因,拿出来让大家共赏。
1,刚接触fvwm,有许多不当之处,希望得到高人指点。(欢迎大家多仍砖头)
2,我好忘事,如不趁热写下来,过一段时间,说不定就忘了如何配置。(^_^放在网上作个备份)



本想第一时间发到sir来,可这两天上不了。郁闷啊!!!!!
发到了”公社“。
http://www.linuxfans.org/nuke/mo ... eninfo&did=1725

先给大伙看几张抓图,再把完整文件贴出。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
 楼主| 发表于 2005-7-8 17:02:19 | 显示全部楼层

前言:

前言:


我的主要参考资源:
1,FVWM FAQ中文版
http://www.linuxfans.org/nuke/mo ... ewtopic&t=67623
2,清华大学王垠博士的《FVWM使用指南》
http://learn.tsinghua.edu.cn/homepage/2001315450/fvwm_frame.html
3,主要参考的配置文件
http://www.pcshow.net/bbs/viewth ... 0683088&fpage=1



FVWM的配置文件是用户目录中的./fvwm/.fvwm2rc
在其中可以把所有的设置都写进去。但我感到把所有的定义都放在一起,不便查找。于是就就把.fvwm2rc分解开了,对于一些具体的方面单独写了配置。
具体说明如下:
.fvwm2rc  (起始文件,主要是些路径及起动时的设置)
f.menu     (菜单)
f.buttonbar (buttonbar模块,就是在我的桌面左上角那一排快捷按钮)
f.taskbar      (taskbar模块,任务条)
f.pager        (pager模块,虚拟桌面切换程序。在我桌面的右上角)
f.style          (窗口样式)
f.Mouse       (鼠标,键盘设定)
f.ButtonStyle (标题栏。按钮的排列,样式等)
f.autohiding    (模块自动隐藏设置)



另外:
1,想用图标,建一目录 ./fvwm/icons  我是把/usr/share/icons/目录中的16X16的图标拷贝过来的
2,墙纸用的是png格式,你只要写上相应的路径即可。
3,./fvwm/imgae目录放的是一些背景图片,用来装饰buttonbar,pager等模块的。
4,我的本地编码是gb2312


使用方法:
1,附件里的是所有配置,只需解压后,拷贝到./fvwm/目录即可。
2,把其中的fvwm2rc文件改名为.fvwm2rc
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-7-8 17:04:09 | 显示全部楼层

(1).fvwm2rc的配置及注释:

################**GKP**#######################
#     虾米 :QQ: 391512866                                                            #
#               Mail:gkp790522@yahoo.com.cn                                        #
#               BLOG:                                                                          #
#http://www.linuxeden.com/forum/blog/index.php?blogId=88495        #
#############################################
#              2005.7.7第四次修改                                                        #
#############################################


# 加入一些路径,FVWM在这些路径中查找后面要用到的图标
ImagePath ${HOME}/.fvwm/image:+
ImagePath ${HOME}/.fvwm/image/small:+
ImagePath ${HOME}/.fvwm/image/title:+
ImagePath ${HOME}/.fvwm/icons:+

#插入另外一个文件file的内容
Read f.strokes
Read f.menu
Read f.buttonbar
Read f.taskbar
Read f.pager
Read f.iconman
Read f.style
Read f.Mouse
Read f.ButtonStyle
Read f.autohiding

# 窗口最大化是两边撑满,而上面留出20个(像素?),下面相应的留出25
EwmhBaseStruts 0 0 20 25

#使用EdgeScroll命令禁止flipping pages(鼠标不会因为接近屏幕边缘而进入相近的桌面)
EdgeScroll 0 0

# 用来设定桌面的大小,这里只设置了一个桌面,但是有8页
DeskTopSize 8x1

# 这里是FVWM的启动函数,加载一些模块
AddToFunc StartFunction
+ I Module FvwmAnimate
+ I Module FvwmPager
+ I Module FvwmButtons -g +0+0
+ I Module FvwmTaskBar
+ I Exec exec fvwm-root -r ~/.fvwm/tp/g-259c.png  #墙纸路径

# 下面是FVWM的退出函数,你可以在这里加入一些FVWM退出时要执行的打操作
AddToFunc ExitFunction
+ I Exec exec sync
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-7-8 17:07:03 | 显示全部楼层

(2)f.style的配置及注释:

###########窗口样式#############

#以“style”开头的语句,用来设置所有窗口的样式。

style * Colorset 42, HilightColorset 41 # to use fg and bg #前景色和后景色
Style * Font "-adobe-helvetica-bold-r-*-*-12-*,-*-simsun-medium-r-*-*-12-*-*-*-*-*-*-*"  #字体
#Style * SmartPlacement, WindowShadeSteps 0, ResizeOutLine
Style * Button 1, Button 2, Button 4, Button 6, Button 8, GrabFocusOff  #标题栏上显示的按钮
Style * BorderWidth 0, HandleWidth 1
Style * NoIcon  #关闭窗口最小化和最大化时的动画。具体效果,看我的第一张抓图。(如你喜欢改变窗口时的动画,就注销此句)
#下面这句是对上一句的补充。窗口最小化时成图标时,默认放在屏幕的左侧。下句是可具体设置其放置在屏幕的位置。(这里设的是在屏幕下面)
#Style * IconBox 50 1050 1050 +15, SloppyFocus, MouseFocusClickRaises  
Style * IndexedIconName
Style * MinOverlapPercentPlacement
Style * MinOverlapPercentPlacementPenalties 2 5 1 2 0.5 50
Style * ResizeOutLine
Style * MouseFocusClickRaises
Style * FocusFollowsMouse #所有窗口,都是鼠标移进去的时候得到键盘聚焦,鼠标移出来就失去聚焦
Style * TileCascadePlacement #窗口出现的时候,先试图找一个可以放下它而不挡住其它窗口的地方,如果不行再采用层叠放置的方式
Style * DecorateTransient

#对所有名字以 "Fvwm" 开头的窗口(一般都是 FVWM 内部的模块)的设置。
#它们都没有标题栏(NoTitle),而且是sticky,也就是说即使桌面切换,它们也一直显示在屏幕上,
Style "Fvwm*"       NoTitle,  Sticky, WindowListSkip
#(BorderWidth 0)边框宽度为 0, CirculateSkip 说明当FVWM要求轮询窗口进行批量操作时,这些窗口不被计算在内
Style "Fvwm*"       BorderWidth 0, CirculateSkipIcon, CirculateSkip
#下面3行说明 FvwmPager, FvwmBanner ,FvwmButtons这3个模块一直显示在最上面,不被其他窗口覆盖。
#Style "FvwmPager"   StaysOnTop
#Style "FvwmBanner"  StaysOnTop
#Style "FvwmButtons"  StaysOnTop,ClickToFocus

#下面是说明对于像“XMMS”等程序不添加标题栏。(XMMS自己有标题栏)
#Style gaim        NoTitle, EwmhMiniIconOverride
Style xmms        NoTitle
Style xine        NoTitle

#使用png图片装饰标题栏。
#AddToFunc StartFunction
#+ I Exec fvwm-root -r $HOME/wallpapers/sea.png

#下面是定义了窗口使用的色彩。(其中41和42号是透明)其他文件里的色彩设定,我都用下面的号码表记。
#Colorset 0 fg #ffffff, fgsh #000000, bg #f6f6f6, sh #4bba43, hi #91b6db, Translucent #283e5e 80
Colorset 0 fg #ffffff, fgsh #000000, bg #f6f6f6, sh #6e90b3, hi #91b6db, Translucent #283e5e 80
Colorset 1 fg #000000, fgsh #b5b7b8, bg #ffffff, hi #ffffff, sh #9a9a9a, Translucent #dce0e7 70
Colorset 3 fg #9aafbf, bg #000000, fgsh #000000, NoShape, RootTransparent, Tint #283e5e 70
Colorset 4 fg #ffffff, bg #000000, fgsh #000000, Noshape, RootTransparent, Tint #101f36 70
Colorset 41 RootTransparent buffer, fg white, bg average, Tint cyan 15, bgTint cyan 15 # tint is optional
Colorset 42 RootTransparent buffer, fg white, bg average, Tint blut 15, bgTint blut 15 # tint is optional

#下面的才是透明的设定,如不使用透明,把下面的注销。
# Style * Colorset 41, HilightColorset 42 # to use fg and bg
BorderStyle Inactive Colorset 42 -- flat
BorderStyle Active Colorset 41 -- flat
TitleStyle AllInactive Colorset 42 -- flat
TitleStyle AllActive Colorset 41 -- flat
#ButtonStyle All -- UseTitleStyle flat
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-7-8 17:10:53 | 显示全部楼层

(3) f.ButtonStyle的配置及注释:

############buttonstyle#################
# 接下来的部分是设置标题栏的。FVWM预设了10个按钮的位置,一般都用不完。我只使用了1,8,6,4,2这五个位置。其中的8号位置还没完成。
# 只是说明一下,FVWM上面标题栏按扭的排列是
# 1 3 5 7 9 0 8 6 4 2
TitleStyle AllActive TiledPixmap bc.xpm ( ColorSet 8 -- Flat )
TitleStyle AllInactive TiledPixmap bc.xpm ( ColorSet 8 -- Flat )
TitleStyle Height 22 -- Flat

ButtonStyle All Simple -- UseTitleStyle
ButtonStyle All -- Flat

AddButtonStyle 1 \
ActiveUp (Pixmap menu.png -- flat) \
ActiveDown (Pixmap menu.png -- flat) \
Inactive (Pixmap menu.png -- flat)

AddButtonStyle 2 \
ActiveUp (Pixmap close.png -- flat) \
ActiveDown (Pixmap close.png -- flat) \
Inactive (Pixmap close.png -- flat)
AddButtonStyle 4 \
ActiveUp (Pixmap max.png -- flat) \
ActiveDown (Pixmap max.png -- flat) \
Inactive (Pixmap max.png -- flat)
AddButtonStyle 6 \
ActiveUp (Pixmap min.png -- flat) \
ActiveDown (Pixmap min.png -- flat) \
Inactive (Pixmap min.png -- flat)
AddButtonStyle 8 \
ActiveUp (Pixmap min.png -- flat) \
ActiveDown (Pixmap min.png -- flat) \
Inactive (Pixmap min.png -- flat)

#按钮的样式
ButtonStyle  2 Inactive Vector 4 30x30@3 60x60@3 60x30@4 30x60@3 -- Flat
ButtonStyle  6 Inactive Vector 7 30x30@3 30x60@3 60x60@3 60x30@3 30x30@3 30x35@3 60x35@3 -- Flat
ButtonStyle  4 Inactive Vector 5 30x60@3 60x60@3 60x50@3 30x50@3 30x60@3 -- Flat
ButtonStyle  8 Inactive Vector 4 44x44@3 44x45@3 45x45@3 44x44@3 -- Flat
ButtonStyle  1 Inactive Vector 4 44x44@3 44x45@3 45x45@3 44x44@3 -- Flat

ButtonStyle  2 active Vector 4 30x30@3 60x60@3 60x30@4 30x60@3 -- Flat
ButtonStyle  4 active Vector 7 30x30@3 30x60@3 60x60@3 60x30@3 30x30@3 30x35@3 60x35@3 -- Flat
ButtonStyle  6 active Vector 5 30x60@3 60x60@3 60x50@3 30x50@3 30x60@3 -- Flat
ButtonStyle  8 active Vector 4 44x44@3 44x45@3 45x45@3 44x44@3 -- Flat
ButtonStyle  1 active Vector 4 44x44@3 44x45@3 45x45@3 44x44@3 -- Flat
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-7-8 17:12:16 | 显示全部楼层

(4)f.Mouse的配置及注释:

#简单的鼠标和键盘设置。

#Mouse 1 R A Nop
Mouse 1 R A WindowList
Mouse 1 1 A Menu MenuFvwmWindowOps Nop
Mouse 1 2 A Close
Mouse 1 6 A Iconify
Mouse 1 4 A Maximize
Mouse 3 R A Menu MenuFvwmRoot
Mouse 1 T A   Move-or-Raise
Mouse 1 I  A   Move-or-Iconify
Mouse 1 W M   Move-or-Raise

Key F1 A        M   Exec exec xterm
Key F2 A        M   Exec exec grun
Key F3 A        M   Module FvwmConsole -terminal rxvt
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 X  A        CM  Exec exec xmag
Key F4 A        CM  Quit
Key R  A        CM  Restart
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-7-8 17:13:40 | 显示全部楼层

(5)f.taskbar的配置及注释:

####################FvwmTaskBar任务条######################

Style FvwmTaskBar NoTitle, WindowListSkip, CirculateSkip, Sticky, BorderWidth 1, NoHandles, StaysOnBottom
Style FvwmTaskBar NeverFocus, Layer 0

DestroyModuleConfig FvwmTaskBar: *
*FvwmTaskBar: Geometry -0-0  #位置
*FvwmTaskBar: Rows 1
*FvwmTaskBar: Font -adobe-helvetica-bold-r-*-*-12-*,-*-simsun-medium-r-*-*-12-*-*-*-*-*-*-*
*FvwmTaskBar: Font "-adobe-helvetica-bold-r-*-*-12-*,-*-simsun-medium-r-*-*-12-*-*-*-*-*-*-*"
*FvwmTaskBar: SelFont -adobe-helvetica-bold-r-*-*-12-*,-*-simsun-medium-r-*-*-12-*-*-*-*-*-*-*
*FvwmTaskBar: Colorset 0
*FvwmTaskBar: AutoStick
*FvwmTaskBar: UseSkipList
*FvwmTaskBar: PageOnly
*FvwmTaskBar: ShowTips
*FvwmTaskBar: TipsColorset 0
*FvwmTaskBar: StartName Debian #开始按钮显示的名称。(这里是Debian,你可以换成“开始”字样)
*FvwmTaskBar: StartMenu MenuFvwmRoot mouse -100p -104m
#*FvwmTaskBar: Pixmap /home/gkp/.fvwm/image/title-active.png
*FvwmTaskBar: NoBrightFocus
*FvwmTaskBar: 3DFvwm
*FvwmTaskBar: MailCheck 0
#下面五段是关于颜色的设定。(背景,黑色。字体,白色)
*FvwmTaskBar: Back #3B3B3B
*FvwmTaskBar: Fore white
*FvwmTaskBar: FocusFore cornsilk
*FvwmTaskBar: IconBack #3B3B3B
*FvwmTaskBar: IconFore white
*FvwmTaskBar: ClockFormat :%R %m/%d #右下角显示时间,日期
*FvwmTaskBar: Action Click 3 Menu MenuFvwmWindowOps mouse -1p -100m #点击“开始按钮”,菜单弹出的位置。


#在任务条上显示的快捷程序。
#*FvwmTaskBar: MailCommand Exec exec rxvt -e mutt
#*FvwmTaskBar: Button NoTitle , Icon home.png, Action (Mouse 1) Exec exec kfmclient openURL $HOME
*FvwmTaskBar: Button NoTitle , Icon mplayer.png, Action (Mouse 1) Exec exec gmplayer
*FvwmTaskBar: Button NoTitle , Icon xmms.png, Action (Mouse 1) Exec exec xmms
#*FvwmTaskBar: Button NoTitle , Icon stardict.png, Action (Mouse 1) Exec exec stardict
*FvwmTaskBar: Button NoTitle , Icon ark.png, Action (Mouse 1) Exec exec ark
*FvwmTaskBar: Button NoTitle , Icon gimp.png, Action (Mouse 1) Exec exec gimp
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-7-8 17:15:23 | 显示全部楼层

(6)f.buttonbar的配置及注释:

########## FvwmButtons ButtonBar #####################

#下面设定的是在我桌面的左上角的一排快捷程序按钮。其具体的样式(透明的),字体等。

FvwmButtons: Hilight3DOff, HilightBack #424164, ActiveFore white
Colorset 0 Transparent,fg white  #颜色
#*FvwmButtons: ShowTips
#*FvwmButtons: FocusFore cornsilk
#*FvwmButtons: NoSeparators
#*FvwmButtons: UseSkipList
*FvwmButtons:  Colorset 0
*FvwmButtons:  Foreground grey90
*FvwmButtons:  Background #1c5572
*FvwmButtons:  Font "-adobe-helvetica-bold-r-*-*-12-*,-*-simsun-medium-r-*-*-12-*-*-*-*-*-*-*"    #显示的字体及大小
#*FvwmButtons: Face VGradient 128 1 #2c80A0 1 #1c5572
#*FvwmButtons: WindowBorderWidth 1
#*FvwmButtons: Window3DBorders
*FvwmButtons:  Geometry +000    #显示在屏幕上的位置》(在左上角)
*FvwmButtons: Columns 8       #显示8个按钮
*FvwmButtons:  Rows 1          #显示 一行
ColormapFocus FollowsFocus
Style FvwmButtons NoTitle,WindowListSkip,BorderWidth 1, HandleWidth 1,Sticky,\
StaysOnTop,CirculateSkip

#下面的是具体设定了哪些程序
#*FvwmButtons: (Title (Side) "", Left, Back #dedbde, Icon term.png, \
Action (Mouse 1) `Exec exec xterm +sb -bg black -fg gray -fw -*-simsun-medium-r-normal-*-*-115-*-*-*-*-iso10646-1`)
# *FvwmButtons: (Title (Side) "文件管理", Left, Back #dedbde, Icon file.png,Action (Mouse 1) `Exec exec xffm`)
*FvwmButoons: (TiTle (Side) "Mlt", Left, Bach #dedbde,Action (Mouse 1) `Exec exec mlterm`)
*FvwmButtons: (Title (Side) "", Left, Back #dedbde, Icon firefox.png,Action (Mouse 1) `Exec exec firefox`)
*FvwmButtons: (Title (Side) "", Left, Back #dedbde, Icon kwrite.png,Action (Mouse 1) `Exec exec kwrite`)
*FvwmButtons: (Title (Side) , Left, Back #dedbde, Icon opera.png,Action (Mouse 1) `Exec exec opera`)
*FvwmButtons: (Title (Side) "", Left, Back #dedbde, Icon xmms.png,Action (Mouse 1) `Exec exec xmms`)
*FvwmButtons: (Title (Side) "", Left, Back #dedbde, Icon gimp.png,Action (Mouse 1) `Exec exec gimp-2.0`)
#*FvwmButtons: (Title (Side) "运行", Left, Back #dedbde, Icon run.png,Action (Mouse 1) `Exec exec grun`)
#*FvwmButtons: (Title (Side) "锁屏", Left, Back #dedbde, Icon lock.png,Action (Mouse 1) `Exec exec xscreensaver-command --lock`)
*FvwmButtons: (Title (Side) "重启", Left, Back #dedbde, Icon reload.png,Action (Mouse 1) `Restart`)
*FvwmButtons: (Title (Side) "退出", Left, Back #dedbde, Icon exit.png,Action (Mouse 1) `Quit`)
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-7-8 17:17:01 | 显示全部楼层

(7)f.pager的配置及注释:

#############FvwmPager###############

#这是在我桌面右上角的,虚拟桌面切换器。
# FvwmPager
#Style FvwmPager HandleWidth 3, BorderWidth 3
#SetEnv FvwmPager-Width "223"
SetEnv FvwmPagerDesktops "8"    #我设了8个虚拟的桌面

PipeRead "echo SetEnv FvwmPager-Width \"$[28*$FvwmPagerDesktops]\""
PipeRead "echo *FvwmPager: Geometry $[FvwmPager-Width]x24--1+-1"   #“X24”是指它显示的大小是24象素。“-1+-1”是它显示在屏幕上的位置。(在右上角)

FvwmPager: Hilight3DOff, HilightBack #424164, ActiveFore white
Colorset 0 Transparent,fg white #颜色
*FvwmPager: MiniIcons
*FvwmPager: Font none
#*FvwmPager: Maximize 100 -30p
#*FvwmPager: AutoHide 1
*FvwmPager: WindowBorderWidth 1
*FvwmPager: Window3DBorders
*FvwmPager: ShowTips
*FvwmPager: FocusFore cornsilk
#*FvwmPager: NoSeparators
*FvwmPager: UseSkipList
*FvwmPager: Colorset * 41   #前景色
*FvwmPager: HilightColorset * 42    #背景色
#*FvwmPager:  Foreground grey90
#*FvwmPager:  Background #1c5572
*FvwmPager: WindowColorsets $[cs-panel-wininactive] $[cs-panel-winactive]
#*FvwmPager: Face VGradient 128 1 #2c80A0 1 #1c5572
     
Style FvwmPager NoTitle,WindowListSkip,BorderWidth 1, HandleWidth 1,Sticky,\
StaysOnTop,CirculateSkip
#Style FvwmPager Sticky, NeverFocus, WindowListSkip, FixedPosition, \
        FixedSize, StaysOnBottom, Handles, BorderWidth 1, HandleWidth 1, \
        NoTitle, NoIcon, Colorset $[cs-panel-border], \
        BorderColorset $[cs-panel-border], \
        HilightColorset $[cs-panel-border], \
        HilightBorderColorset $[cs-panel-border]

#PipeRead "echo DesktopSize ${FvwmPagerDesktops}x1"
DesktopSize 8x1
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-7-8 17:18:36 | 显示全部楼层

(8)f.autohiding的配置及注释:

######模块自动隐藏##########


# The autohiding functions
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 $2
+ I Schedule $0 $[w.id] Deschedule $[w.id]

# Start FvwmAuto
AddToFunc StartFunction
+ I Module FvwmAuto FvwmAutohide -menter enter_handler

#下面以"+ I"开头的是你设定要隐藏的模块。最后一个参数“S”表示隐藏的方向,这里是“向上”。相应的参数有N, S, E, W, NW, NE, SW or SE。
# Add the windows you want to autohide
AddToFunc enter_handler
+ I autohide FvwmButtons 500 S
+ I autohide FvwmPager 500 S
# + I autohide FvwmTaskBar 500 N    #由于taskbar(任务条)还可以在f.taskbar里设置隐藏功能,我就在这里注销了这句。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表