Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7174
  • 博文数量: 1
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 10
  • 用 户 组: 普通用户
  • 注册时间: 2013-08-30 17:46
文章分类
文章存档

2013年(1)

我的朋友
最近访客

分类: LINUX

2013-08-30 17:46:52

原文地址:一个简单的FVWM配置 作者:mmx384

这是我配置的一份极其简单的FVWM配置文件,效果可看附图。

按照下面的配置,出来的效果比较简陋,水平有限没办法,真正要掌握如何配置FVWM,只有读manpage。而且也没有必要一定要把它设置得多华丽,我始终信奉UNIX的KISS原则,我的大脑不如别人聪明,复杂的事情记不住,只有把它做简单。配置越好,功能越多,启用的模块也越多,占用内存就越大,浪费在次要事情上的时间也越多。

这里是完整的配置文件和图标文件的打包下载(里面的.fvwm2rc与下面贴出来的配置文件可能不同):

文件:fvwm2rc-20071228.tar.bz2
大小:1220KB
下载:下载

压缩包目录结构:
.fvwm
 |-- .fvwm2rc  配置文件
 |-- .fvwm2rc.mmx 一份旧的配置文件的copy
 |-- readme    简单说明
 |-- image/    包含一些图标和一张墙纸
 |-- TimeAndDateNormal 在FvwmButtons中显示时间的脚本


#
#        简单功能说明
#

1.这个配置用FvwmButtons模块仿xfce4的样子做了一个类似QuickLaunch的东西,不用TaskBar或IconMan是因为窗口最小化后以一个图标显示在桌面上,简洁而方便。

2.启用了虚拟页面但没有将其显示于botton或desktop中,仅设置了快捷键进行切换。一些常用的功能如下:
       鼠标左键双击标题栏,在常规窗口与最大化窗口之间切换
       自己最常用的程序在botton中启动(可以设置点左键或右键启动不同的程序)
       不常用的程序在终端中启动,或用Win + X + [某个字母]的方式启动
       并没有设置过多的菜单,以使桌面更加简洁。
       要退出FVWM,可以按Win(左)键后,半秒内按Esc

3.显示时间改用xclock,当然你也可以用脚本TimeAndDateNormal

4. ClickToFocus,MouseFocusClickRaises
   Style * CenterPlacement
这两个样式设置是我使用后觉得最满意的设置。

5.中文支持,在我的电脑上显示很好,不过如果出现不能启动的情况,可以将下面一行注释掉:
# Style * Font "shadow=0 0 SE:xft:size=12:encoding=iso10646-1"

6.标题栏左上角增加了一个M键,指music,也指MLdonkey,这是一个开关键,用鼠标左键单击它将启动/关闭xmms2 play播放音乐,用鼠标右键单击它将启动/关闭mlnet。(当然,你可以自己编一个更符合自己要求的脚本来做其它的事)

7.增加了FvwmIdent模块,可以显示窗口信息等(Alt+F1)。

8.加了一个快捷键,使AcroRead5浏览PDF可以用滚轮,AcroRead7太大了。

9.增加了控制xmms2播放音乐的快捷键

一  配置文件(~/.fvwm/.fvwm2rc)

#----------------------------------------------------------------
#                                                              #
# FVWM F(?) Virtual Window Manager 2.5.14 Configuration        #
#        By ( mmx384@tom.com )                                 #
#                                                              #
#----------------------------------------------------------------
#
# 修改颜色可对照:/usr/X11R6/lib/X11/rgb.txt
# 按键名称可参照:/usr/include/X11/keysymdef.h
#
# 需进一步改善的功能:
#     切换虚拟桌面时,在虚拟桌面上显示页号

#----------------------------------------------------------------
#

ImagePath $[HOME]/.fvwm/image

IgnoreModifiers L25
SnapAttraction 5
EdgeScroll 0 0
EdgeResistance 1000 0
EdgeThickness 1
ClickTime 200
HideGeometryWindow Always
MoveThreshold 5
OpaqueMoveSize 100
SnapGrid 1 1
#EwmhBaseStruts 0 0 0 0
#XORvalue 255


#-------------------- Style Setting -----------------------------

DefaultFont "-misc-simsun-medium-r-normal-*-*-160-*-*-p-*-iso10646-1"
#DefaultFont "shadow=0 0 xft:simsun:size=12:encoding=iso10646-1"

Style "*" ClickToFocus,MouseFocusClickRaises
Style "*" CenterPlacement
Style "*" MwmFunctions,MWMBorder,MWMDecor,NoPPosition
Style "*" DecorateTransient


#Style "*" Colorset 3, HilightColorset 4
Style "*" ForeColor black, BackColor dodgerblue2
Style "*" HilightFore white, HilightBack dodgerblue
Style "*" NoIconTitle
Style "*" BorderWidth 2, HandleWidth 3
Style "FvwmButtons" NoTitle,NoHandles,WindowListSkip, \
            BorderWidth 0,CirculateSkipIcon,CirculateSkip
Style "FvwmIdent" NoTitle,NoHandles,BorderWidth 0

#Style "*" NoIcon
#Style "Fvwm*" StaysOnTop,Sticky


MenuStyle "*" MWM
#MenuStyle "*" FVWM
MenuStyle "*" Hilight3Doff, PopupOffset +0 100, PopupDelay 150
MenuStyle "*" Foreground Black, Background White
MenuStyle "*" ActiveFore Red
MenuStyle "*" MenuFace HGradient 128 2 lightgrey 0 Gray 50 White


Style "*" Button 1, Button 2, Button 3, Button 4, Button 6
#Style "*" MWMButtons
TitleStyle Centered Height 20
#TitleStyle -- flat
#ButtonStyle All -- UseTitleStyle flat

ButtonStyle 1 Pixmap buttons/menu.png
ButtonStyle 2 Pixmap buttons/close.png
ButtonStyle 4 Pixmap buttons/maximize.png
ButtonStyle 6 Pixmap buttons/iconify.png
ButtonStyle 3 5 25x75@0 25x25@0 50x70@0 75x25@0 75x75@0
#ButtonStyle 3 7 15x25@0 15x75@0 35x75@4 35x25@0 55x70@0 75x25@0 75x75@0


CursorStyle Root left_ptr
CursorStyle Default left_ptr
CursorStyle Title left_ptr
#CursorStyle Sys left_ptr
CursorStyle Menu left_ptr
CursorStyle resize fleur
CursorStyle stroke cross
CursorStyle select draped_box

#Style "Untitled" NoTitle
Style "Emacs"    Icon 48x48/emacs.png
Style "urxvt"    Icon 48x48/rxvt.png
Style "MPlayer" NoTitle,NoHandles,BorderWidth 0
Style "*vim"     IconOverride, Icon 48x48/gvim.png
Style "GQview"     IconOverride, Icon 48x48/gqview.png
Style "xclock"     NoTitle,NoHandles,BorderWidth 0,StaysOnTop
Style "AcroRead" Icon 48x48/acroread.png,VariablePosition,VariableUSPosition
Style "*"    Icon 48x48/unknow.png


DestroyMenu WindowOps
AddToMenu WindowOps
+    "MoveTo Page 0 0"     MoveToPage 0 0
+    "MoveTo Page 0 1"     MoveToPage 0 1
+    "MoveTo Page 0 2"     MoveToPage 0 2
+    "MoveTo Page 0 3"     MoveToPage 0 3
+    ""                    Nop
+    "Disable Close    "   Key F4 A A -
+    "Disable Super_L"     Key Super_L A A -
+    ""                    Nop
+    "Identify Window"     Module FvwmIdent
+    "Stick"               Pick Stick
+    "Refresh"             Refresh
+    "Close Window"        Close
+    ""                    Nop
+    "Restart FVWM"        Restart fvwm


#--------------- Mouse & Key ------------------------------------

#CmdNameButton    Context    Modifiers Function
Mouse     1     R     A     Nop
Mouse     3     R     A     Menu xmms2client
Mouse     1     I     A     Iconify
Mouse     1     T     A     Function RaiseOrMaximize
#Mouse    3     T     A     Iconify
Mouse     1     1     A     Menu WindowOps Nop
Mouse     3     1     A     Close
Mouse     1     3     A     Exec (status=`pgrep xmms2d`; \
                            [ ${#status} -gt 6 ] &&    xmms2 next || xmms2 play)
Mouse     3     3     A     Exec ( status=`pgrep mlnet`; \
                            [ -n ${status} ] && pkill mlnet || $HOME/bin/mlnet &)
Mouse     1     2     A     Close
Mouse     1     4     A     Maximize
Mouse     3     4     A     Function MoveOrResizeWindow
Mouse     1     6     A     Iconify
#Mouse    1     6     A     Thumbnail
Mouse     4     W     A     Current ("AcroRead") FakeKeypress \
                            press Up \
                            press Up
Mouse     5     W     A     Current ("AcroRead") FakeKeypress \
                            press Down \
                            press Down


#CmdNameKeyname    Context    Modifiers Function
#Key   Super_L    A    A    Menu RootMenu Nop
Key    F1         A    M    Module FvwmIdent
Key    Print      A    M    Exec import image$(date +%N).jpg
Key    Left       A    CM   gotopage +0p -1p
Key    Right      A    CM   gotopage +0p +1p
Key    F4         A    M    Key F4 A A Close
Key    F5         A    M    Current ("ROX-Filer") Function refresh_misc
Key    X          A    4    Function SuperR_X_ActionRunningCommand
Key    Super_L    A    A    Function SuperL_ActionTodoSomething



#----------------- Function -------------------------------------

DestroyFunc InitFunction
AddToFunc InitFunction
+    I    Exec fcitx &
+    I    Exec fvwm-root $[FVWM_USERDIR]/image/wallpaper.png &

DestroyFunc StartFunction
AddToFunc StartFunction
#+    I    Module FvwmAuto 320 Raise Nop
+     I    Module FvwmButtons FvwmButtonsLaunch
+     I    Module FvwmAnimate

DestroyFunc ExitFunction
AddToFunc ExitFunction
+     I    KillModule FvwmButtons
+     I    KillModule FvwmAnimate
#+    I    Close All


DestroyFunc RaiseOrMaximize
AddToFunc RaiseOrMaximize
+ "Click"       Raise
+ "Motion"      Raise
+ "Motion"      Move
+ "DoubleClick" Raise
+ "DoubleClick" Maximize


DestroyMenu xmms2client
AddToMenu xmms2client " xmms2clinet " title
+    " toggle"      exec (xmms2 toggleplay)
+    " next"        exec (xmms2 next)
+    " prev"        exec (xmms2 prev)
+    " play"        exec (xmms2 play)
+    ""             nop
+    " stop"        exec (xmms2 stop)
+    " allstop"     exec (killall mplayer;xmms2 stop)
+    ""             nop
+    " ++volume "   exec (xmms2 volume +5)
+    " --volume "   exec (xmms2 volume -5)


DestroyFunc MoveOrResizeWindow
AddToFunc MoveOrResizeWindow
+    I    Resize 680p 560p
+    I    Move 15 10

DestroyFunc refresh_misc
AddToFunc refresh_misc
+    I    exec (ls /mnt/misc/{cd,u0,u1} 2>&1 >/dev/null)

#DestroyFunc HideAndLower
#AddToFunc HideAndLower
#+    I    WindowShade True
#+    I    Lower

#DestroyFunc ShadeAndRaise
#AddToFunc ShadeAndRaise
#+    I    Raise
#+    I    WindowShade False


#DestroyFunc FuncFvwmMenuDirectory
#AddToFunc FuncFvwmMenuDirectory
#+ I    PipeRead 'fvwm-menu-directory --dir "$0" \
#    --order 5 -l \
#    --title "%*-20p" --exec-file "^${execapp:-xmms}"'


#AddToMenu MenuMusic MissingSubmenuFunction FuncFvwmMenuDirectory
#+ "Music" Popup "$[HOME]/music"


DestroyFunc SuperL_ActionTodoSomething
AddToFunc SuperL_ActionTodoSomething
+    I    Mouse 1 W C Destroy
+    I    Key H A A All (CurrentPage !iconic !FvwmButtons) \
                 Iconify
+    I    Key B A A     All ( CurrentPage "FvwmButtons" ) RaiseLower
+    I    Key Escape A A Quit
+    I    Schedule 500 Mouse 1 W C -
+    I    Schedule 500 Key H A A -
+    I    Schedule 500 Key B A A -
+    I    Schedule 500 Key Escape A A -

DestroyFunc SuperR_X_ActionRunningCommand
AddToFunc SuperR_X_ActionRunningCommand
+    I    Key Q A N nop
+    I    Key W A N Exec firefox
+    I    Key E A N Exec emacs
+    I    Key R A N nop
+    I    Key T A N Exec rxvt
+    I    Key A A N Exec pidgin
+    I    Key S A N Exec scilab
+    I    Key D A N Exec stardict
+    I    Key F A N Exec rox
+    I    Key G A N Exec gimp
+    I    Key Z A N nop
+    I    Key X A N nop
+    I    Key C A N Exec xcalc &
+    I    Key V A N Exec vim -g
+    I    Key B A N Exec azureus
+    I    Schedule 1000 Key Q A N -
+    I    Schedule 1000 Key W A N -
+    I    Schedule 1000 Key E A N -
+    I    Schedule 1000 Key R A N -
+    I    Schedule 1000 Key T A N -
+    I    Schedule 1000 Key A A N -
+    I    Schedule 1000 Key S A N -
+    I    Schedule 1000 Key D A N -
+    I    Schedule 1000 Key F A N -
+    I    Schedule 1000 Key G A N -
+    I    Schedule 1000 Key Z A N -
+    I    Schedule 1000 Key X A N -
+    I    Schedule 1000 Key C A N -
+    I    Schedule 1000 Key V A N -
+    I    Schedule 1000 Key B A N -


#------------------ Modules -------------------------------------

DestroyModuleConfig FvwmAnimate: *
*FvwmAnimate: Color white
#*FvwmAnimate: Effect frame
*FvwmAnimate: Delay 2
*FvwmAnimate: Iterations 30
*FvwmAnimate: Width 3


#        Virtual Page
# +-----+-----+-----+-----+
# |  0  |  2  |  3  |
# +-----+-----+-----+-----+
DeskTopSize 1x4
DestroyModuleConfig FvwmPager: *
*FvwmPager: Fore dodgerblue
*FvwmPager: Back #c3c3c3
*FvwmPager: Hilight #c3c3c3
*FvwmPager: Font None


# FvwmIdent is an xwininfo replacement.
DestroyModuleConfig FvwmIdent: *
*FvwmIdent: Back MidnightBlue
*FvwmIdent: Fore white
*FvwmIdent: Font "xft:sans:pixelsize=14:minspace=True"


#        FvwmButtons (FvwmButtonsLaunch:48x1)
#     1  4   4   4   4   4   4   4   4   2      12     1 (48)
#    +-+---+---+---+---+---+---+---+---+--+---+---+---+-+
#    | |   |   |   |   |   |   |   |   |  HH:MM:SS | |
#    +-+---+---+---+---+---+---+---+---+--+---+---+---+-+
DestroyModuleConfig FvwmButtonsLaunch: *
*FvwmButtonsLaunch: Geometry 512x45+250-0
*FvwmButtonsLaunch: Fore #c3c3c3
*FvwmButtonsLaunch: Back #c3c3c3
*FvwmButtonsLaunch: Font None
*FvwmButtonsLaunch: (Frame 3 Container(Rows 1 Columns 48 ))
*FvwmButtonsLaunch: ( 1x1 frame 0 )
*FvwmButtonsLaunch: ( 4x1 frame 0 Icon 32x32/rox.png, \
    ActiveIcon 24x24/rox.png \
    Action(Mouse 1) 'Exec rox')
*FvwmButtonsLaunch: ( 4x1 frame 0 Icon 32x32/rxvt.png, \
    ActiveIcon 24x24/rxvt.png \
    Action(Mouse 1)    'Exec rxvt')
*FvwmButtonsLaunch: ( 4x1 frame 0 Icon 32x32/firefox.png, \
    ActiveIcon 24x24/firefox.png \
    Action(Mouse 1) 'Exec firefox', \
    Action(Mouse 3) 'Exec opera &')
*FvwmButtonsLaunch: ( 4x1 frame 0 Icon 32x32/gvim.png, \
    ActiveIcon 24x24/gvim.png \
    Action(Mouse 1) 'Exec gvim', \
    Action(Mouse 3) 'Exec gvim $[HOME]/.fvwm/.fvwm2rc')
*FvwmButtonsLaunch: ( 4x1 frame 0 Icon 32x32/emacs.png, \
    ActiveIcon 24x24/emacs.png \
    Action(Mouse 1) 'Exec emacs')
*FvwmButtonsLaunch: ( 4x1 frame 0 Icon 32x32/gimp.png, \
    ActiveIcon 24x24/gimp.png \
    Action(Mouse 1) 'Exec gimp')
*FvwmButtonsLaunch: ( 4x1 frame 0 Icon 32x32/gqview.png, \
    ActiveIcon 24x24/gqview.png \
    Action(Mouse 1)    'Exec gqview')
*FvwmButtonsLaunch: ( 4x1 frame 0 Icon 32x32/swrite.png, \
    ActiveIcon 24x24/swrite.png \
    Action(Mouse 1) 'Exec soffice')
*FvwmButtonsLaunch: ( 2x1 Frame 0 )
#*FvwmButtonsLaunch: ( 12x1 Frame 0 Swallow "TimeAndDateNormal" \
#    `FvwmScript $[HOME]/.fvwm/TimeAndDateNormal`)
*FvwmButtonsLaunch: ( 12x1 Frame 0 Swallow "xclock" `Exec xclock \
        -digital -update 1 -face 'Aguafont:size=21' \
        -strftime '%H:%M:%S' -bg rgb:c3/c3/c3`)



二 效果图

阅读(1686) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:没有了

给主人留下些什么吧!~~