靓丽OpenBSD桌面
作者: rainren
本文环境: OpenBSD 3.5
OpenBSD的强项是网络安全, 主要是使用PF构建防火墙. 但OpenBSD也有简单这个特性, 在它的系统里, 简单是一个特点; 也就是说让你的系统管理很简单.
今天, 我在这里show 一下我的桌面配置过程, 当然也请使用过fvwm的高手们指点一下我配置过程中的错误.
一. 配置fvwm桌面
OpenBSD3.5使用fvwm2.2.5作为默认的桌面, 当然, 如果你在安装系统时没有安装xserver.tgz等几个包, 现在也可以将那些包下载到硬盘上, 然后再:
Tar xvzfp *.tgz
安装这些软件包来使用桌面环境.
配置好XF86Config, startx出现的桌面是系统的缺省配置桌面, 这个配置文件.fvwmrc在/usr/X11R6/lib/X11/fvwm下, 在这个目录下还有关于fvwm使用的模块列表及另外一些桌面的配置文件. 介绍一下桌面位置: 左上角: +0+0, 左下角: +0-0, 右上角: -0+0, 右下角: -0-0!
如果你想深入了解fvwm的配置情况, 可以参考网上各种fvwm的学习教程, 下面我只是说一下我的改动情况!
Fvwm使用的图片格式是xpm, png, 你可以使用gimp将你使用的图片转换成xpm格式. 在配置文件中的颜色值可以是一个英文名或一个十六进制值。
首先, 我们在根目录下建立.fvwm文件夹, 然后
cp /usr/X11R6/lib/X11/fvwm/.fvwmrc ~/.fvwm/.fvwm2rc
下面, 将以我对~/.fvwm/.fvwm2rc文件所做的改动为例, 说说如何配置桌面:
# be sure to customize these paths for your installation:
ModulePath /usr/X11R6/lib/X11/fvwm[color=red:8fa26d1069]模块的路径名[/color:8fa26d1069]
PixmapPath /usr/X11R6/include/X11/pixmaps[color=red:8fa26d1069]fvwm使用图片的路径, 桌面背景图片就是放在这里, 我使用的桌面背景图片是:openbsddesktop.xpm[/color:8fa26d1069]
IconPath /usr/X11R6/include/X11/bitmaps
EdgeResistance 250 100
EdgeScroll 50 50[color=red:8fa26d1069]当mouse移到桌面边缘时, 桌面的移动情况[/color:8fa26d1069]
ClickTime 750
# make sure these fonts exist on your system:
WindowFont -adobe-times-bold-r-*-*-14-*-*-*-*-*-*-*[color=red:8fa26d1069]窗口使用的字体[/color:8fa26d1069]
IconFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
HilightColor blue #898e84 [color=red:8fa26d1069]窗口的高亮显示时的颜色[/color:8fa26d1069]
MenuStyle #b0d5fc gray40 #49c671 -adobe-times-bold-r-*-*-12-*-*-*-*-*-*-* fvwm[color=red:8fa26d1069]菜单使用的前景色, 背景色,阴影色, 字体类型[/color:8fa26d1069]
DeskTopSize 2x2 [color=red:8fa26d1069] 每一个虚拟桌面的大小[/color:8fa26d1069]
ColormapFocus FollowsMouse
# default Styles:
Style "*" BorderWidth 5, HandleWidth 5, NoHandles [color=red:8fa26d1069]在这里我加了一个NoHandles, 也就是窗口不要柄 [/color:8fa26d1069]
Style "*" Icon unknown1.xpm, Color green/#698593[color=red:8fa26d1069] 定义窗口颜色 [/color:8fa26d1069]
Style "*" MWMFunctions, MWMDecor, HintOverride
Style "*" DecorateTransient, NoPPosition
Style "*" IconBox -0 -1 +1 -1
Style "*" SloppyFocus, FocusFollowsMouse
Style "*" RandomPlacement, SmartPlacement
# Styles for various Fvwm modules:
Style "Fvwm*" NoTitle, Sticky, WindowListSkip
Style "Fvwm*" BorderWidth 2, CirculateSkipIcon, CirculateSkip
Style "FvwmPager" StaysOnTop
Style "FvwmBanner" StaysOnTop
Style "FvwmButtons" Icon toolbox.xpm, ClickToFocus
# Styles for your common terminal emulator programs:
AddToDecor terms
+ ButtonStyle 1 Pixmap mini.xterm.xpm
+ HilightColor blue #898e84
Style "XTerm" UseDecor terms
Style "XTerm" Icon xterm.xpm, SloppyFocus, IconBox -70 1 -1 -140
Style "rxvt" UseDecor terms
Style "rxvt" Icon term.xpm, SloppyFocus, IconBox -70 1 -1 -140
Style "rxvt" MWMBorder, MWMButtons
# Styles for various common programs:
Style "xcalc" Icon xcalc.xpm, NoButton 2,RandomPlacement,ClickToFocus
Style "xmh" Icon mail1.xpm, NoIconTitle,StickyIcon
Style "xmh" RandomPlacement, NoButton 2
Style "xman" Icon xman.xpm, RandomPlacement, ClickToFocus
Style "xmag" Icon mag_glass.xpm, RandomPlacement, ClickToFocus
Style "xgraph" Icon graphs.xpm, RandomPlacement, ClickToFocus
Style "xmosaic" Color Green/Yellow, ClickToFocus
Style "xdaliclock" NoTitle, NoHandles, Sticky, WindowListSkip, ClickToFocus[color=red:8fa26d1069]你看到, 我的桌面上有一个电子钟, 在这里定义它的显示类型, 这样我就可以在每一个虚拟桌面上都看到它了。 [/color:8fa26d1069]
#Style "xconsole" Icon rterm.xpm, WindowListSkip, Sticky
# some simple default key bindings:
Key Next A SCM Next [*] Focus
Key Prior A SCM Prev [*] Focus
# some simple default mouse bindings:
# for the root window:
Mouse 1 R A Menu RootMenu Nop
Mouse 2 R A Menu Window-Ops Nop
Mouse 3 R A WindowList
[color=red:8fa26d1069]窗口title上的各按键的定义说明[/color:8fa26d1069]
# for the title bar buttons:
Mouse 0 1 A Menu Window-Ops2 Close
Mouse 0 2 A Close
Mouse 0 4 A Iconify
Mouse 1 6 A Maximize-Func
# for other parts of the window/borders/icons:
Mouse 1 F A Resize-or-Raise
Mouse 1 TS A Move-or-Raise
Mouse 1 I A Move-or-Iconify
Mouse 2 I A Iconify
Mouse 2 FST A Menu Window-Ops2 Nop
Mouse 3 TSIF A RaiseLower
[color=red:8fa26d1069] fvwm启动时的初始函数,配置文件中使用的模块要在这里启动 [/color:8fa26d1069]
######################## Initialization Functions ############################
AddToFunc InitFunction "I" Module FvwmPager 0 3 [color=red:8fa26d1069]虚拟桌面的启动情况[/color:8fa26d1069]
+ "I" Module FvwmButtons
+ "I" Module FvwmAuto 500 Raise Nop
+ "I" Exec exec /usr/X11R6/bin/xpmroot /usr/X11R6/lib/X11/xdm/pixmaps/openbsd.xpm[color=red:8fa26d1069]设置桌面背景图片[/color:8fa26d1069]
[color=red:8fa26d1069]fvwm重启时的操作[/color:8fa26d1069]
AddToFunc RestartFunction "I" Module FvwmPager 0 3
+ "I" Module FvwmButtons
+ "I" Module FvwmAuto 500 Raise Nop
+ "I" Exec exec /usr/X11R6/bin/xpmroot /usr/X11R6/lib/X11/xdm/pixmaps/openbsd.xpm
[color=red:8fa26d1069] 下面是菜单的配置情况, 当你安装了新的软件时, 可以在这里将它们加到菜单中去。[/color:8fa26d1069]
######################## Menus ###################
AddToMenu RootMenu "Root Menu" Title
+ "XTerm%mini.xterm.xpm%" Exec exec xterm
+ "Rxvt" Exec exec rxvt
+ "Mozilla-Firefox" Exec exec firefox[color=red:8fa26d1069]我安装的上网软件[/color:8fa26d1069]
+ "" Nop
#+ "Remote Logins" Popup Remote-Logins
#+ "" Nop
+ "Utilities" Popup Utilities
+ "" Nop
+ "Fvwm Modules" Popup Module-Popup
+ "Fvwm Window Ops" Popup Window-Ops
+ "Fvwm Simple Config Ops" Popup Misc-Ops
+ "" Nop
+ "Refresh Screen" Refresh
+ "Recapture Screen" Recapture
+ "(Re)Start" Popup Quit-Verify
+ "" Nop
+ "Exit" Module FvwmForm QuitVerify
[color=red:8fa26d1069] 定义的子菜单[/color:8fa26d1069]
AddToMenu Utilities "Utilities" Title
+ "Top" Exec exec xterm -T Top -n Top -e top
+ "Calculator" Exec exec xcalc
+ "Xman" Exec exec xman
+ "Xmag" Exec exec xmag
+ "Editres" Exec exec editres
+ "" Nop
#+ "XEmacs" Exec exec xemacs
#+ "Mail" MailFunction xmh "-font fixed"
+ "Reset X defaults" Exec xrdb -load $HOME/.Xdefaults
AddToMenu Misc-Ops "Misc Config Opts" Title
+ "Sloppy Focus" ChangeDefaultFocus SloppyFocus
+ "Click To Focus" ChangeDefaultFocus ClickToFocus
+ "Focus Follows Mouse" ChangeDefaultFocus FocusFollowsMouse
+ "" Nop
+ "Colormap Follows Mouse" ColormapFocus FollowsMouse
+ "Colormap Follows Focus" ColormapFocus FollowsFocus