LinuxSir.cn,穿越时空的Linuxsir!

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

fvwm图标最小化问题

[复制链接]
发表于 2007-5-12 18:32:09 | 显示全部楼层 |阅读模式
今天定义fvwm的图标,发现使用

  1. Style xpdf         
  2.                         Icon $[fvwm_icon48]/xpdf.png, \
  3.                         MiniIcon $[fvwm_icon24]/xpdf.png, \
复制代码

定义后不能使用
只能定义为:

  1. Style Xpdf        
  2.                         Icon $[fvwm_icon48]/xpdf.png, \
  3.                         MiniIcon $[fvwm_icon24]/xpdf.png, \
复制代码

xpdf中的X必须大写才行。

后来发现,窗口图标化后和窗口的标题有关,比如星际译王,只能这样定义:

  1. Style "星际译王"        
  2.                         Icon $[fvwm_icon48]/xpdf.png, \
  3.                         MiniIcon $[fvwm_icon24]/xpdf.png, \
复制代码

图标才能工作。

所以在此想问一下老鸟,如何定义才能使窗口直接使用原来的程序名称,
例如:星际译王   使用  stardict
Xpdf   使用 xpdf
等等....

谢谢!
发表于 2007-5-13 22:42:34 | 显示全部楼层
fvwm.lair.be 有篇帖子里有解释的, 记得大意是fvwm的Style其实是按一定的顺序来找
窗口信息的, 一般都不是根据程序名来判断. 如Style "Firefox", 看起来能行(因为程序窗
口的标题中有Firefox), 但其实最好的方式是Style "Firefox-bin", 据称这样执行起来更
快.

所以答案是: 你要的这种方式一般不存在.
回复 支持 反对

使用道具 举报

发表于 2007-5-13 23:16:35 | 显示全部楼层
Style stardict          Sticky, MiniIcon $[fvwm_icon]/stardict.png

我的可以呀
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-5-14 17:24:54 | 显示全部楼层
Post by izzystar
fvwm.lair.be 有篇帖子里有解释的, 记得大意是fvwm的Style其实是按一定的顺序来找
窗口信息的, 一般都不是根据程序名来判断. 如Style "Firefox", 看起来能行(因为程序窗
口的标题中有Firefox), 但其实最好的方式是Style "Firefox-bin", 据称这样执行起来更
快.

所以答案是: 你要的这种方式一般不存在.

我使用:

  1. Style Firefox-bin Style-setting-for-firefox
复制代码

并没有起作用

fvwm论坛帖子地址能否提供一下?:%
回复 支持 反对

使用道具 举报

发表于 2007-5-14 18:43:13 | 显示全部楼层
发现我保存有那篇文章.......

How to set Style lines
======================

This text is taken in part from my reply in the following thread:
http://fvwm.lair.be/viewtopic.php?t=772

Over the years, I've seen a lot of FVWM configs that have lines for styles
that look like this:

``
Style myapp* NoStick, NoTitle
Style Fvwm* NoBorders, NoTitle, CirculateSkip, Sticky
Style Mozilla* NoTitle
''

... which by and large are "OK", except for a few problems -- they're
greedy matches, as one would expect with '*'.

Most people I have helped, have problems with Firefox or Mozilla not
doing what it's told, or getting some very odd results with the styles
that they're defining for it.   The reason for this isn't that Mozilla or
Firefox are misbehaved, but usually that there's a lack of understanding
with how Style lines are applied.

Let's assume that we're using the style lines from above:

``
Style Fvwm* NoBorders, NoTitle, CirculateSkip, Sticky
''

... this matches (in part) some of Firefox's title.  If one were to then
restart FVWM with this page still showing in Firefox, then the window
would stick, which is annoying.  It's certainly not what we want.  Most
people naturally do this, too:

``
Style *Firefox* NoBorders
''

Which also has the same problems, and perhaps even more so, since that's
matching Firefox anywhere within the title of a window.  

To get around this, something more unique needs to be used.  With dynamically
changing titles such as a webbrowser, specifying the full name of the window
is undesirable as well, and ineffective, as it just won't work.  Hence
FVWM allows us to also match by a window's class, as well.

Take Firefox.  That will either have a class of:

``
Firefox-bin
''

or:

``
Gecko
''

The reason you want to match on a window's class in this instance is that
it's more specific, and less ambiguous than the title of the window, which
might be something like this:

``
Fvwm Forums :: Post a reply - Mozilla Firefox
''

To obtain a specific window's class, you can use a few methods.  Perhaps
the preferred option is using the module "FvwmIdent".  Although window
manager agnostic commands such as "xwininfo" and "xprop" can also be
used.  Hence, you'd replace the previous style command with:

``
Style Gecko NoTitle
''

... you can be fairly well assured that the Class of a window tends to be
unique to that application (the exceptions are things like RXVT which
sometimes have been known to set their class to that of Xterm.)

Indeed, you might be wondering how FVWM knows in which order style lines
match.  Truth is, it doesn't _really_ know how to match, however FVWM
defaults to cycling through a known series of window attributes.  Hence,
FVWM will match your window in a style line thus:

``
Title --> Class --> Resource
''
x
So FVWM checks the title of a window first, and if a match is unsuccessful,
it will then look at the class, and if that fails, it will then look at
the resource of that window for a match.  By and large, where wildcards
are used in style lines -- it's normally the window's title that gets
matched in the first instance.

There are other considerations that need to be taken into account.  Style
lines are ANDed.  That is, for successive lines that are specified one
after the other for the same application, both lines are considered.   
So for the following:

``
Style foo Sticky
Style foo !Title
''

The window 'foo' would only be displayed with the title, and would
become sticky.  Because of this, the ordering of style lines is VERY
important so that there's no race conditions, or other oddities that can
creep in.

One thing I'd love to see in a future version of FVWM is something like:

``
Style (class=Xterm, title=foo) StartsOnPage 0 4
''
... which would really be quite powerful.  This is in the TODO file for
FVWM.

-- Thomas Adam, 20th September 2005, 17:18 GMT
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-5-15 22:14:34 | 显示全部楼层
太感谢了!!!
回复 支持 反对

使用道具 举报

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

本版积分规则

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