|
发表于 2005-10-6 21:56:41
|
显示全部楼层
很好,又有FVWM的同道中人了
MAC风格的桌面确实很漂亮,不过实现起来难度也很大,对于勇于向高难度挑战的人,我们是应该敬佩才是。
花点时间研究FVWM是绝对超值的,通过不断的配置FVWM来实现自己越来越多的想法可以获得无限成就感和乐趣(FVWM论坛上也有无数人在玩FVWM配置乐此不疲,我们的人数是太少了),还可以慢慢领略到她的设计思想,更进一步的配置还可以练就shell和perl的功力。比FVWM配置更复杂的软件没多少个,玩转了FVWM后,配置Linux下任何一个其他软件都是piece of cake了
关于上面提到的几个问题,我发表一下我的一些小心得
1、用程序的缩略图作为最小化时的图标,在《FVWM FAQ》的7.18节里有非常详细的介绍:
http://www.linuxfans.org/nuke/modules.php?name=Forums&file=viewtopic&t=67623
我也是看着它来弄的,这是我的修改过的代码,仅仅是把缩略图的路径改为/dev/shm/:
[code:1]
#######################################################################
#
# Thumbnail function
#
######################################################################
## Minimizes to thumbnail
DestroyFunc FvwmMinimize
AddToFunc FvwmMinimize
+ H Nop
+ M Nop
+ C Thumbnail
+ D WindowShade
SetEnv fvwm_icon_size 100
SetEnv fvwm_thumb_dir /dev/shm
AddToFunc StartFunction
+ I test (Restart) all (iconic)\
test (f $[fvwm_thumb_dir]/icon.tmp.$[w.id].png)\
windowstyle iconoverride, icon $[fvwm_thumb_dir]/icon.tmp.$[w.id].png
DestroyFunc Thumbnail
AddToFunc Thumbnail
+ I Raise
+ I ThisWindow (!Iconic) SetEnv Icon-$[w.id] $[w.iconfile]
+ I SetEnv Layer-$[w.id] $[w.layer]
+ I ThisWindow (Iconifiable, !Iconic) PipeRead \
"xwd -silent -id $[w.id] | convert -scale $[fvwm_icon_size] \
-mattecolor black -frame 1x1 -quality 0 \
xwd:- png:$[fvwm_thumb_dir]/icon.tmp.$[w.id].png \
&& echo WindowStyle IconOverride, \
Icon $[fvwm_thumb_dir]/icon.tmp.$[w.id].png \
|| echo Nop"
+ I TestRc (Match) Test (f $[w.miniiconfile], f $[fvwm_thumb_dir]/icon.tmp.$[w.id].png) PipeRead \
"composite -geometry +2+4 $[w.miniiconfile] \
$[fvwm_thumb_dir]/icon.tmp.$[w.id].png \
$[fvwm_thumb_dir]/icon.tmp.$[w.id].png; echo Nop"
+ I Iconify
+ I ThisWindow (Iconic) Layer 0 0
DestroyFunc DeThumbnail
AddToFunc DeThumbnail
+ I PipeRead "echo Test \\(i \\$\\[Icon-$[w.id]\\]\\) WindowStyle Icon \\$\\[Icon-$[w.id]\\]"
+ I PipeRead "echo Layer 0 \\$\\[Layer-$[w.id]\\]"
+ I TestRc (NoMatch) WindowStyle NoIconOverride, Icon
+ I Exec rm -f $[fvwm_thumb_dir]/icon.tmp.$[w.id].png
+ I All (Iconic, CurrentPage) PlaceAgain icon
+ I UnsetEnv Icon-$[w.id]
+ I UnsetEnv Layer-$[w.id]
+ I Iconify
[/code:1]
2、关于菜单背景,如果用MenuFace Pixmap生成的菜单背景好象是不能改变Highlight的选项的颜色的,
不过可以有灵活的方法实现:就是只定义菜单边框的背景,而菜单中间的文字部分仍采用纯色,
这样Highlight的时候就可以改变颜色了。下面是一个这种效果的主菜单的实现代码,
有兴趣可以试试(图片需要解压到~/.fvwm中,没有图片菜单的效果会一团糟):
[code:1]
#######################################################################
#
# MAC like Pixmap Menu by PEM
#
######################################################################
# press left or right win key, and popup the root menu
Key Super_L A A Menu FvwmRootMenu mouse -1p -1p
Key Super_R A A Menu FvwmRootMenu mouse -1p -1p
# Pixmap menu
Colorset 5 fg white, bg white, hi rgb:05/46/a0, fgsh rgb:05/46/a0, \
Shape $[FVWM_USERDIR]/menu_shape.xpm, \
RootTransparent buffer, Tint white 85
# Hilighted menu item
Colorset 6 fg rgb:05/46/a0, bg rgb:05/46/a0, hi white, fgsh white
# Other menu
Colorset 60 fg white, bg white, hi rgb:05/46/a0, sh rgb:05/46/a0, \
fgsh rgb:05/46/a0, Translucent white 60
# Menu styles
MenuStyle PixmapMenu BorderWidth 0, HilightBack, ActiveFore
MenuStyle PixmapMenu MenuColorset 5, ActiveColorset 6
MenuStyle PixmapMenu Hilight3DThickness 0, Animation
MenuStyle PixmapMenu Font "Shadow=1 C:xft:Blippo:pixelsize=16"
MenuStyle PixmapMenu PopupImmediately, PopdownImmediately, PopupOffset 0 100
MenuStyle PixmapMenu TitleUnderlines0, TrianglesSolid
MenuStyle PixmapMenu ItemFormat "%s%|%5.i%5.5l%5.5r%.5>%|%i"
MenuStyle PixmapMenu VerticalItemSpacing 0, VerticalTitleSpacing 0
MenuStyle * BorderWidth 3, HilightBack, ActiveFore
MenuStyle * MenuColorset 60, ActiveColorset 6
MenuStyle * Hilight3DThickness 0, Animation
MenuStyle * Font "Shadow=1 C:xft:Blippo:pixelsize=16"
MenuStyle * PopupDelay 300, PopdownImmediately, PopupOffset 0 100
MenuStyle * TitleUnderlines1, TrianglesSolid
MenuStyle * ItemFormat "%s%|%5.i%5.5l%5.5r%.5>%|"
MenuStyle * VerticalItemSpacing 0, VerticalTitleSpacing 0
# Root Menu
DestroyMenu FvwmRootMenu
AddToMenu "FvwmRootMenu@$[FVWM_USERDIR]/menu_side.png@"
+ *$[FVWM_USERDIR]/menu_up.png* Title
+ %$[FVWM_USERDIR]/gnome-home.png%"&Home"%$[FVWM_USERDIR]/menu_right.png% \
exec exec nautilus
+ %$[FVWM_USERDIR]/gnome-terminal.png%"&Terminal"%$[FVWM_USERDIR]/menu_right.png% \
exec exec gnome-terminal
+ %$[FVWM_USERDIR]/web-browser.png%"&Navigator"%$[FVWM_USERDIR]/menu_right.png% \
exec exec opera
+ %$[FVWM_USERDIR]/gedit-icon.png%"&Editor"%$[FVWM_USERDIR]/menu_right.png% \
exec exec gedit
+ %$[FVWM_USERDIR]/evolution.png%"&Evolution"%$[FVWM_USERDIR]/menu_right.png% \
exec exec evolution
+ %$[FVWM_USERDIR]/media-play.png%"&Office"%$[FVWM_USERDIR]/menu_right.png% \
popup MenuOffice
+ %$[FVWM_USERDIR]/media-play.png%"&Development"%$[FVWM_USERDIR]/menu_right.png% \
popup MenuDevelopment
+ %$[FVWM_USERDIR]/media-play.png%"&Graphic"%$[FVWM_USERDIR]/menu_right.png% \
popup MenuGraphism
+ %$[FVWM_USERDIR]/media-play.png%"&Internet"%$[FVWM_USERDIR]/menu_right.png% \
popup MenuInternet
+ %$[FVWM_USERDIR]/media-play.png%"&Game"%$[FVWM_USERDIR]/menu_right.png% \
popup MenuGame
+ %$[FVWM_USERDIR]/media-play.png%"&Multimedia"%$[FVWM_USERDIR]/menu_right.png% \
popup MenuMultimedia
+ %$[FVWM_USERDIR]/media-play.png%"&Config"%$[FVWM_USERDIR]/menu_right.png% \
popup MenuConfig
+ %$[FVWM_USERDIR]/media-play.png%"&Utilities"%$[FVWM_USERDIR]/menu_right.png% \
popup MenuUtilities
+ %$[FVWM_USERDIR]/panel-logout.png%"&Quit"%$[FVWM_USERDIR]/menu_right.png% \
popup MenuQuit-Verify
+ *$[FVWM_USERDIR]/menu_down.png* Title
ChangeMenuStyle PixmapMenu FvwmRootMenu
[/code:1]
**复制代码要注意把每行最后一个空格(其实不是空格)去掉
3、关于阴影,我也很想了解如何实现,我用的版本是2.5.14 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
×
|