Difference between revisions of "Xinit (简体中文)"

From ArchWiki
Jump to navigation Jump to search
m (fixed i18n)
(added {{translateme}})
Line 1: Line 1:
[[Category:Desktop environments (简体中文)]]
[[Category:Desktop environments (简体中文)]]

Revision as of 16:54, 8 July 2009

Tango-preferences-desktop-locale.pngThis article or section needs to be translated.Tango-preferences-desktop-locale.png

Notes: please use the first argument of the template to provide more detailed indications. (Discuss in Talk:Xinit (简体中文)#)

Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n links end

xinit用来启动的X Window系统服务器和系统中第一个客户端程序,它们不能直接从/etc/init启动或用于多头显示的环境。因此.xinitrc文件是一种通常与直接从inittab运行startx脚本结合使用的启动X的简单方法。


The .xinitrc file is really just one more shell script to run. It can be used to start various applications you want to associate with starting X, e.g. the X screensaver, and to set global environment variables, like MOZ_PLUGIN_PATH. It's foremost use however, is as a replacement for a display manager when on a single user machine. When you do not start a display manager it is important to keep in mind that the life of your X session starts and ends with the .xinitrc script. What this means is that once the script finishes, X quits, regardless of whether you still have running programs, including your window manager. It is therefore important that the window manager quitting and X quitting should coincide. This is usually achieved by running the window manager as the last thing in the .xinitrc script, e.g.

/usr/bin/xscreensaver -no-splash &
/usr/lib/notification-daemon/notification-daemon &
export MOZ_PLUGIN_PATH="/usr/lib/mozilla/plugins:/opt/mozilla/lib/plugins"
exec openbox-session

Notice that the screensaver and the notification daemon are run in the background. Otherwise the script would halt and wait for the screensaver program to quit before continuing. The variable export line will run and quit very quickly. The line starting Openbox, however is not backgrounded. This ensures that the script will not quit until Openbox does. If you run the startx script manually ending the script will terminate x and leave you with whatever VCs your inittab has started. If you're running it from inittab and has set the line to 'respawn' (rather than 'once'), xinitrc will be run again. This way you can restart X without having to restart the computer.


使用这个模板时你可简单地取消注释你喜欢的,例如 Gnome

# ~~/.xinitrc
# 被startx执行 (从这里运行你的窗口管理器)
# exec ion
# exec wmaker
# exec startkde
# exec icewm
# exec blackbox
exec gnome-session
# exec startfluxbox
# exec startxfce4
# exec openbox
# exec startlxde




 xinit /full/path/to/window-manager


 xinit /usr/bin/enlightenment -- -br +bs -dpi 96