指南 - 在Hoary中设置你的窗口,让它更加漂亮

参与到Ubuntu的翻译中来
回复
头像
freeflying
帖子: 521
注册时间: 2005-03-26 9:38

指南 - 在Hoary中设置你的窗口,让它更加漂亮

#1

帖子 freeflying » 2005-04-12 22:38

(NOTE: THIS ONLY WORKS IN HOARY, DOES NOT WORK IN WARTY. Also, since I use an nvidia card, I'm not sure how well this will work in ATI. I've put in some ATI instructions that I've read but I'm not 100% sure if they'd work.)

I've spent the last day and a half trying to get compositing working in ubuntu. This is actually an amalgamation of a bunch of guides I've found; I shouldn't be given full credit for this.

The first thing you need to do is install xcompmgr and transset. These are found in the hoary universe repositories, if you havent already done so, enable the universe repo in your /etc/apt/sources.list. Its not very hard to do this, search the forums for how to do it

Code:

代码: 全选

sudo apt-get install xcompmgr transset

xcompmgr is the composite manager (the program/extension that makes things look pretty) and transset sets windows transparencies.

Now, the next thing you have to do is actually enable compositing. This is done via a simple edit of your /etc/X11/xorg.conf

Code:

代码: 全选

sudo gedit /etc/X11/xorg.conf


Add the following section after the "module" section:

Code:

代码: 全选

Section "Extensions" Option "Composite" "Enable" EndSection

This tells xorg to enable compositing. Now, just so you know, unless you have a good video card, compositing most likely slow down xorg. Apparantly nvidia cards fare better than ati cards, since you can enable acceleration (which we'll do later) which'll actually make x use your video card for rendering.

As I said earlier, if you have an nvidia card it'll run better. I'm assuming you've already installed the nvidia binary drivers and such, if you haven't then do so. Add the following lines to the "device" section:

Code:

代码: 全选

Option "RenderAccel" "true" Option "AllowGLXWithComposite" "true"

"RenderAccel" is actually an option you should already have if you're running an nvidia card, but I've included it incase you haven't put it in yet. I'm pretty sure this only works on nvidia cards; can someone tell me if there's an equivelant for ati?

"AllowGLXWithComposite" is a command that allows you to use OpenGL while compositing is running. Apparantly it can be buggy, though, so if you have problems you might want to disable compositing in your xorg.conf whenever you want to use opengl (just comment out the compositing option with #)

Now, if you have an ati card, add these lines instead:

Code:

代码: 全选

Option "backingstore" "true" Option "AllowGLXWithComposite" "true"

According to a cached google page, backingstore is "used to enable the server's support for backing store, a mechanism by which pixel data for occluded window regions is remembered by the server thereby alleviating the need to send expose events to X clients when the data needs to be redisplayed."

(Since I don't own an ati card, I apologize if any of my facts are incorrect. If someone with an ati card can correct me, I'll make sure to update this.)

OK, now for the really fun part. We're going to actually set it so compositing is enabled when you start GNOME. Go to system -> preference -> sessions. Go to startup programs, and click "add."

Now, before I continue, I'm going to explain a few of xcompmgr's options:

-c : enable shadows
-s : enable simple shadows
-fF : enable fadeins/fadeouts

You can mix-and-match those commands. For example, if you want just shadows, use xcompmgr -c. If you want simple shadows, use xcompmgr -s. If you want to enable shadows and fadeins, use xcompmgr -cfF. I wouldn't recommend using -cs; that'll probably break the program.

So, where it asks you for the command, enter xcompmgr and then the argument. For example, if you'd like to enable shadows and fadeins/fadeouts, you'd enter:

Code:

代码: 全选

xcompmgr -cfF

Finally, in the order, change it to 0. This'll make sure it's the first thing that GNOME runs. Apparantly things run much better this way.

Alright! Now you can restart X (ctrl+alt+backspace), log back in, and you should have compositing running!

Using Transset

This is just an extra little command. If you want to set certain windows as transparent, then run the command "transset" in the console. Your mouse will turn into a crosshair; simply click on the window you want to set as transparent. The transparency value can be anywhere from 0 (completely transparent) to 1 (opaque.) It defaults to .75, and back to 1 if the window is already transparent.

For example, if you want to make a window half-transparent:

Code:

代码: 全选

transset 0.5

[/code]
沙子
帖子: 4
注册时间: 2005-04-13 13:18

#2

帖子 沙子 » 2005-04-13 20:52

(NOTE: THIS ONLY WORKS IN HOARY, DOES NOT WORK IN WARTY. Also, since I use an nvidia card, I'm not sure how well this will work in ATI. I've put in some ATI instructions that I've read but I'm not 100% sure if they'd work.)
(注意:这只能在HORTY上实现,不能在WARTY上实现。并且,由于我使用nvidia显卡,我不确定是否可以在ATI显卡下工作。我加入了一些我能理解的ATI的指令,但我还是不能100%确信他们在工作。)

I've spent the last day and a half trying to get compositing working in ubuntu. This is actually an amalgamation of a bunch of guides I've found; I shouldn't be given full credit for this.
我用尽了所有的力量使他能够在ubuntu下运行。这是由我发现的一些指南合并而成的;我已经不能给出这个文档的名单。

The first thing you need to do is install xcompmgr and transset. These are found in the hoary universe repositories, if you havent already done so, enable the universe repo in your /etc/apt/sources.list. Its not very hard to do this, search the forums for how to do it
你首先要做的第一件事是安装xcompmgr和transset。他们在hoary的universe仓库下,如果你还没有做,在你的/etc/apt/sources.list下添加universe。这不是很难的,论坛可以得到答案。
代码:

代码: 全选

sudo apt-get install xcompmgr transset

xcompmgr is the composite manager (the program/extension that makes things look pretty) and transset sets windows transparencies.
xcompmgr是混合管理器(这个程序/扩展使得界面看更漂亮)而transset可以设置窗口透明。

Now, the next thing you have to do is actually enable compositing. This is done via a simple edit of your /etc/X11/xorg.conf
现在,你要做的就是设置允许混合,这只要简单的编辑你的/etc/X11/xorg.conf

代码:

代码: 全选

sudo gedit /etc/X11/xorg.conf

Add the following section after the "module" section:
在"module"章节后添加下列章节

代码:

代码: 全选

Section "Extensions" Option "Composite" "Enable" EndSection

This tells xorg to enable compositing. Now, just so you know, unless you have a good video card, compositing most likely slow down xorg. Apparantly nvidia cards fare better than ati cards, since you can enable acceleration (which we'll do later) which'll actually make x use your video card for rendering.
这是告诉xorg允许混合。现在你要知道混合大多数情况下可能会减慢xorg,除非你有一个好的显卡。装备nvidia显卡要比ati显卡感觉要好,因为你可以设置加速(后面就要设置)这可以使得X使用显卡来渲染。

As I said earlier, if you have an nvidia card it'll run better. I'm assuming you've already installed the nvidia binary drivers and such, if you haven't then do so. Add the following lines to the "device" section:
象我以前所说,如果你有一块nvidia显卡它就能更好的工作。我姑且认为你已经装好了niadia的驱动,如果你还没做,就跟着做下面的。在"device"章节后添加下列几行:

代码:

代码: 全选

Option "RenderAccel" "true" Option "AllowGLXWithComposite" "true"

"RenderAccel" is actually an option you should already have if you're running an nvidia card, but I've included it incase you haven't put it in yet. I'm pretty sure this only works on nvidia cards; can someone tell me if there's an equivelant for ati?
"RenderAccel"如果你使用nvidia显卡早就应该加上这个选项,我加了这个是因为你可能还没有加上它。我非常确信这只能在nvidia下工作;有人能告诉我ati和等价语句吗?

"AllowGLXWithComposite" is a command that allows you to use OpenGL while compositing is running. Apparantly it can be buggy, though, so if you have problems you might want to disable compositing in your xorg.conf whenever you want to use opengl (just comment out the compositing option with #)
"AllowGLXWithComposite"是一个命令允许你在打开混合时使用OpenGL。使用它可能会出现BUG,所以当使用OpenGL出现问题时你应该使得混合选项失效(只须在option前加一个#号)

Now, if you have an ati card, add these lines instead:
当你用的是ati显卡时,用下列语句代替:

代码:

代码: 全选

Option "backingstore" "true" Option "AllowGLXWithComposite" "true"

According to a cached google page, backingstore is "used to enable the server's support for backing store, a mechanism by which pixel data for occluded window regions is remembered by the server thereby alleviating the need to send expose events to X clients when the data needs to be redisplayed."
根据google搜索页面,backingstore是“用于允许服务器支持后台存储,通过它当象素数据需要重新显示时,被遮挡的窗口层的象素数据就记录在服务器上,从而减轻了传送前台数据给X客户端的需求。

(Since I don't own an ati card, I apologize if any of my facts are incorrect. If someone with an ati card can correct me, I'll make sure to update this.)
{由于我没有ati显卡,如果我所说的不正确我只能说对不起。如果有人能纠正我的做法,我保证我会更新这些。)

OK, now for the really fun part. We're going to actually set it so compositing is enabled when you start GNOME. Go to system -> preference -> sessions. Go to startup programs, and click "add."
OK,真正有趣的部分开始了。我们来让GNOME启动时激活混合功能。依次点击 系统-> 首选项->会话。点击启动程序选项,再点击"添加"

Now, before I continue, I'm going to explain a few of xcompmgr's options:
在继续之前,先解释一些xcompmgr的参数:

-c : enable shadows
-s : enable simple shadows
-fF : enable fadeins/fadeouts

-c : 允许阴影
-s : 允许简单阴影
-fF : 允许渐入/渐出

You can mix-and-match those commands. For example, if you want just shadows, use xcompmgr -c. If you want simple shadows, use xcompmgr -s. If you want to enable shadows and fadeins, use xcompmgr -cfF. I wouldn't recommend using -cs; that'll probably break the program.
你可以 混合这些选项。例子,如果你只需要阴影就使用xcompmgr -c。如果你要简单阴影使用xcompmgr -s。如果你要阴影和渐入使用xcompmgr -cfF。我不推荐使用-cs,这可能会中断程序使用。

So, where it asks you for the command, enter xcompmgr and then the argument. For example, if you'd like to enable shadows and fadeins/fadeouts, you'd enter:
所以在启动命令输入框里输入xcompmgr再跟上参数。例子如果你喜欢加上阴影和渐入渐出,你可以输入:

代码:

代码: 全选

xcompmgr -cfF

Finally, in the order, change it to 0. This'll make sure it's the first thing that GNOME runs. Apparantly things run much better this way.
最后,在顺序里改为0。这可以使得在运行GNOME时首先就运行它。这个方法可以使它工作的更好。

Alright! Now you can restart X (ctrl+alt+backspace), log back in, and you should have compositing running!
好了!现在你可以重启X(按ctrl+alt+backspace),重新登录,你的混合功能已经在运行了!

Using Transset
使用透明

This is just an extra little command. If you want to set certain windows as transparent, then run the command "transset" in the console. Your mouse will turn into a crosshair; simply click on the window you want to set as transparent. The transparency value can be anywhere from 0 (completely transparent) to 1 (opaque.) It defaults to .75, and back to 1 if the window is already transparent.
这只是一个特别的小命令。如果你想使一定的窗口透明,在终端里运行命令"transset"。你的鼠标指针会变成一个“十”字,单击你想透明的窗口。透明度的值可以从0(完全透明)到1(不透明),它的缺省值是.75,如果窗口已经透明则会回到1。

For example, if you want to make a window half-transparent:
例子,如果你想使窗口半透明:

代码:

代码: 全选

transset 0.5
-----------------------
不知道compositing用什么词好,就直接翻成了混合 :oops:
头像
firehare
帖子: 2625
注册时间: 2005-04-10 16:54
来自: 温州大学
联系:

#3

帖子 firehare » 2005-04-13 21:01

兄弟辛苦了!
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

#4

帖子 oneleaf » 2005-04-13 21:59

当净其意如虚空,远离妄想及诸取,令心所向皆无碍
zhuzhzh
帖子: 265
注册时间: 2005-07-28 15:08

#5

帖子 zhuzhzh » 2005-07-30 20:42

用脚本应该怎么做呢?

我试着做,可以sed不太会用
无声胜有声
头像
leiv
帖子: 38
注册时间: 2005-10-10 22:50

#6

帖子 leiv » 2005-12-15 22:08

我按照上面说的做了,结果重启gnome后就进不去了。
把/etc/X11/xorg.conf改过来后还是不能进入gnome。输入用户和密码后就是一片黄色,能听到启动时的声音就是一直是什么东西都看不到。
之前我按照所说的在系统-> 首选项->会话的启动程序选项里面加了xcompmgr -cfF也是把它的顺序设为0,我现在想在shell下把它取消,应该用什么命令呢?还是有其他的解决办法?谢谢:)
头像
GOVO
帖子: 427
注册时间: 2005-05-15 3:09

#7

帖子 GOVO » 2005-12-16 15:20

偶也不行,最后还是把home/.gnome2/session-manual删除了才能进入gnome。还有,用在论坛上搜索叶兄的xorg.conf的设置方法就更不行,连在covery下的X也进入不了,最后还是得把xorg.conf删除了才行。
琴声如我
头像
GOVO
帖子: 427
注册时间: 2005-05-15 3:09

#8

帖子 GOVO » 2005-12-16 18:55

哗,我用这个方法OK了!只是成设置xcompmgr -cfF 时,不要设为0,就设为50,让GNOME先进来再启用这个xcompmgr 就可以顺利进入GNOME了。
琴声如我
头像
millenniumdark
论坛版主
帖子: 4159
注册时间: 2005-07-02 14:41
系统: Ubuntu 14.04 (Kylin)
联系:

#9

帖子 millenniumdark » 2006-07-29 19:00

似乎过时了,先放着。
头像
jarryson
帖子: 4002
注册时间: 2005-08-14 19:53

#10

帖子 jarryson » 2006-07-31 0:02

As I said earlier, if you have an nvidia card it'll run better. I'm assuming you've already installed the nvidia binary drivers and such, if you haven't then do so. Add the following lines to the "device" section:
象我以前所说,如果你有一块nvidia显卡它就能更好的工作。我姑且认为你已经装好了niadia的驱动,如果你还没做,就跟着做下面的。在"device"章节后添加下列几行:

代码:
代码:

Option "RenderAccel" "true" Option "AllowGLXWithComposite" "true"

这里似乎翻译有误‘

Add the following lines to the "device" section:

应该是在"device" section中添加而非在之后添加

应该有别与
Add the following section after the "module" section:
在"module"章节后添加下列章节

不过谢谢翻译了 嘿嘿 正在搞这东西
回复