个人工具

“UbuntuHelp:AddingProgramToSessionStartup/zh”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
(未显示同一用户的3个中间版本)
第10行: 第10行:
 
每一次你登录到Ubuntu,都是在创建一个“会话”。要定制你的会话,你必须修改会话的设置。按照如下步骤来做:
 
每一次你登录到Ubuntu,都是在创建一个“会话”。要定制你的会话,你必须修改会话的设置。按照如下步骤来做:
 
* '''系统 > 首选项 > 会话'''
 
* '''系统 > 首选项 > 会话'''
Ubuntu打开一个允许你设定会话设置的对话框。在Ubuntu 8.04有三个标签:“会话选项”,“当前会话”和“会话自启动程序”。
+
Ubuntu打开一个允许你设定会话设置的对话框。在Ubuntu 8.04有三个标签:“会话选项”,“当前会话”和“会话启动程序”。
 
{|border="1" cellspacing="0"
 
{|border="1" cellspacing="0"
 
|https://help.ubuntu.com/community/AddingProgramToSessionStartup?action=AttachFile&do=get&target=sessions.png
 
|https://help.ubuntu.com/community/AddingProgramToSessionStartup?action=AttachFile&do=get&target=sessions.png
 
|}
 
|}
=== 会话自启动程序 ===
+
=== 会话启动程序 ===
 
这个标签允许你指定在你创建会话时运行的任意程序。一个例子就是网络管理器(nm-applet)——一个让用户更容易连接无线的程序。  
 
这个标签允许你指定在你创建会话时运行的任意程序。一个例子就是网络管理器(nm-applet)——一个让用户更容易连接无线的程序。  
=== ADD ===
+
=== 添加程序 ===
To add an applications click the "Add" button and type in the command you would use to run the application. If the program is called "evolution" the command would be evolution, but there are options, as well, that can be added to the command. '''(see below)'''.
+
点击“添加”按钮来添加一个程序,并且在弹出的对话框中输入运行那个程序所需要的命令。如果程序是“evolution”邮件客户端,那么命令行就是evolution,如果有参数,也可以加紧命令行。'''(往下看)'''.
 
{|border="1" cellspacing="0"
 
{|border="1" cellspacing="0"
 
|https://help.ubuntu.com/community/AddingProgramToSessionStartup?action=AttachFile&do=get&target=ADD.png
 
|https://help.ubuntu.com/community/AddingProgramToSessionStartup?action=AttachFile&do=get&target=ADD.png
 
|}
 
|}
 
<<BR>>
 
<<BR>>
=== How to find the appropriate startup command ===
+
=== 如何找到合适的自启动命令 ===
As an example consider the Evolution mail client. Imagine you want to load Evolution every time you start up, instead of clicking on the "Evolution Mail" icon in the panel bar to launch the program. You can add the appropriate command to the '''Startup Programs''' tab.
+
以Evolution邮件客户端为例。想象你想每次开机自动运行Evolution,而不是点击Evolution在面板的图标。你可以在'''会话启动程序'''标签中添加合适的命令。找到屏幕上端面板上的“Evolution”的图标。右击它并选择“属性”。这回弹出“启动器属性的对话框”。注意命令栏中的命令。点击那行命令来把光标移至命令栏中,然后使用方向键向右移,来查看整个命令。
Find the icon for Evolution in the panel bar at the top of the screen. Right click on it, and select "Properties." This will bring up the "Launcher Properties" dialog box. Notice the command in the "Command field." It may be necessary to place a cursor in the field by clicking on the line. Then use the arrow key to move right, to see the entire command.
+
 
{|border="1" cellspacing="0"
 
{|border="1" cellspacing="0"
 
|https://help.ubuntu.com/community/AddingProgramToSessionStartup?action=AttachFile&do=get&target=properties.png
 
|https://help.ubuntu.com/community/AddingProgramToSessionStartup?action=AttachFile&do=get&target=properties.png
 
|}
 
|}
In this case, the command is:
+
在这个案例中,命令是:
 
'''evolution --component=mail'''
 
'''evolution --component=mail'''
Now we want to add this line as the command in the '''Add Startup Program''' dialog box. The Name Field can be any name you choose.
+
现在我们把这一行作为命令加进'''添加开机程序'''对话框中。可以选择任意名字添加进名字一栏。''步骤总结:''
''To summarize:''
+
* 系统 > 首选项 > 会话
* Go to System > Preferences > Sessions
+
* 选择“会话启动程序”标签
* Select the "Startup Programs" tab
+
* 点击“添加”
* Click add
+
* 输入称呼程序的名字(任意名字都行)
* Enter a name to call the application (any name will do)
+
* 在“命令栏”中,输入命令
* In the "Startup command box," enter the command
+
* 点击“确定”(你应该看到你的新命令)
* Click OK (You should see your new command)
+
* 点击“关闭”
* Click Close
+
重启或登出与登录来测试。
Test by restarting or logging out and back in.
+
=== 想添加的应用程序不在面板上 ===
=== If the application you want to add does not have an icon in the menu bar ===
+
首先,在菜单中找到程序 —— “不要运行”,右击来获得“右键菜单”并选择“将启动器添加到面板”。这会把一个应用程序的图标放到桌面上端的面板上。现在你可以按照上面的步骤来查找和复制合适的命令。如果你想在完成后把图标从面板移除,右键并选择“从面板移除”。
First, locate the application in the menu structure -- ''do not select it to run'', right mouse click to get the ''context menu'' and select "Add this launcher to panel."
+
=== 阻止一个应用程序开机启动 ===
This will place an icon for the application on the panel at the top of the desktop. Now you can follow the steps above to find and copy the appropriate command.
+
如果你不再想应用程序在登陆时启动:
If you wish to remove the icon from your panel after you have done this, simply right click and select "Remove from panel."
+
* 系统 > 首选项 > 会话
=== To stop an application from running at startup ===
+
* 选择“会话启动程序”标签
If you no longer want the application to start up when you logon:
+
* 选择你想移除的程序
* Go to System > Preferences > Sessions
+
* 点击“移除”
* Select the "Startup Programs" tab
+
* 点击“关闭”
* Select the application you want to remove
+
'''或者'''
* Click Remove
+
* 取消对话框程序名字旁边的复选框
* Click Close
+
=== 会话选项 ===
'''OR'''
+
* Un-check the box next to the name of the application
+
=== Session Options ===
+
 
{|border="1" cellspacing="0"
 
{|border="1" cellspacing="0"
 
|https://help.ubuntu.com/community/AddingProgramToSessionStartup?action=AttachFile&do=get&target=options.png
 
|https://help.ubuntu.com/community/AddingProgramToSessionStartup?action=AttachFile&do=get&target=options.png
 
|}
 
|}
This tab allows you to tell the system to remember what applications are running at logout, and start those applications at the beginning of your next login. This is accomplished by checking the box '''Automatically remember running applications when logging out.''' Similarly, clicking the '''floppy disk''' icon, tells the system to remember the applications that are currently running (if pidgin where running, for example), and to start those applications at the beginning of your next section.
+
这个标签允许你告诉系统记得登出时正在运行的应用程序,且在下次登录开始时运行这些程序。这依靠勾选'''注销时自动记住正在运行的应用程序'''的复选框来完成。''' 相似地,点击'''软盘'''图标,告诉系统记住当前运行的应用程序(例如pidgin),且在下个会话开始时运行那些应用程序。
=== Current Session ===
+
=== 当前会话 ===
This tab shows the processes that are currently running.
+
这个标签显示当前运行的进程。
=== Modifying program run options ===
+
=== 修改程序运行选项 ===
Now you may wish to modify the way an application works at startup.  This is possible through command line options,  there are parts to the command line:
+
现在你可能想修改程序开机时的运行方式。可以通过命令行的参数来达到,命令行分为几个部分:
 
<pre><nowiki>
 
<pre><nowiki>
 
evolution --component=mail
 
evolution --component=mail
 
</nowiki></pre>
 
</nowiki></pre>
The first part "evolution" is the command that is running.
+
第一部分“evolution”是运行的命令。
The second part "--component=mail" is called an option.  You can modify the way evolution starts up by changing this option.  The real trick is to find out what the command line supports.  You might try [http://www.google.com Google] to search for these options.  You can test these out on a command line:
+
第二部分呃“--component=mail”叫做参数。你可以修改这个参数来修改evolution的启动方式。真正的窍门是找出命令支持什么参数。你可以通过[http://www.google.com Google]查找这些参数。你可以通过终端来测试这些参数:
* '''Applications > Accessories > Terminal'''
+
* '''程序 > 附件 > 终端'''
And try out variations first. Once you have it right then you can change the settings in startup.
+
找出变化。当你找到正确的参数就可以修改开机的参数。
Good luck...
+
祝你好运……
=== Moving applications to a workspace on startup and other advanced options ===
+
=== 开机时把程序移到一个工作区和其它高级参数 ===
Using the way described above, all the applications start in one workspace, maximized and so on. If you wished for example to start an application in workspace 2 minimized, you would have to do it manually - unless you install devilspie - detailed howto can be found on the forums: [http://ubuntuforums.org/showthread.php?t=75749t]  
+
在使用上面描述的方法后,所有的应用程序运行在同一个工作区,最大化等等。如果你希望在工作区2最小化运行一个程序,你可以手动达到目的——除非你安装了devilspie——详情可以在论坛的贴[http://ubuntuforums.org/showthread.php?t=75749t] 中找到。
=== Comments ===
+
=== 建议 ===
This is a very handy way to start [http://www.gdesklets.de/ gdesklet], Firestarter (firewall) or other applications automatically. Some applications will actually add themselves to your Startup Programs tab after you configure them for the first time.
+
这是一种非常手动的方法去自动运行[http://www.gdesklets.de/ gdesklet],Firestarter(防火墙)或者其它程序。一些程序会在你第一次配置他们时把自己添加进“会话启动程序”标签。
 
----
 
----
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2009年10月3日 (六) 21:53的最新版本

有两个方法使Ubuntu在开机时自动加载程序:

  1. 当你登出的时候保存会话,在你再次登录的时候应用程序会自动加载。
  2. 设置Ubuntu,使到在你登录的时候运行指定的应用程序。

会话首选项对话框

每一次你登录到Ubuntu,都是在创建一个“会话”。要定制你的会话,你必须修改会话的设置。按照如下步骤来做:

  • 系统 > 首选项 > 会话

Ubuntu打开一个允许你设定会话设置的对话框。在Ubuntu 8.04有三个标签:“会话选项”,“当前会话”和“会话启动程序”。

AddingProgramToSessionStartup?action=AttachFile&do=get&target=sessions.png

会话启动程序

这个标签允许你指定在你创建会话时运行的任意程序。一个例子就是网络管理器(nm-applet)——一个让用户更容易连接无线的程序。

添加程序

点击“添加”按钮来添加一个程序,并且在弹出的对话框中输入运行那个程序所需要的命令。如果程序是“evolution”邮件客户端,那么命令行就是evolution,如果有参数,也可以加紧命令行。(往下看).

AddingProgramToSessionStartup?action=AttachFile&do=get&target=ADD.png

<
>

如何找到合适的自启动命令

以Evolution邮件客户端为例。想象你想每次开机自动运行Evolution,而不是点击Evolution在面板的图标。你可以在会话启动程序标签中添加合适的命令。找到屏幕上端面板上的“Evolution”的图标。右击它并选择“属性”。这回弹出“启动器属性的对话框”。注意命令栏中的命令。点击那行命令来把光标移至命令栏中,然后使用方向键向右移,来查看整个命令。

AddingProgramToSessionStartup?action=AttachFile&do=get&target=properties.png

在这个案例中,命令是: evolution --component=mail 现在我们把这一行作为命令加进添加开机程序对话框中。可以选择任意名字添加进名字一栏。步骤总结:

  • 系统 > 首选项 > 会话
  • 选择“会话启动程序”标签
  • 点击“添加”
  • 输入称呼程序的名字(任意名字都行)
  • 在“命令栏”中,输入命令
  • 点击“确定”(你应该看到你的新命令)
  • 点击“关闭”

重启或登出与登录来测试。

想添加的应用程序不在面板上

首先,在菜单中找到程序 —— “不要运行”,右击来获得“右键菜单”并选择“将启动器添加到面板”。这会把一个应用程序的图标放到桌面上端的面板上。现在你可以按照上面的步骤来查找和复制合适的命令。如果你想在完成后把图标从面板移除,右键并选择“从面板移除”。

阻止一个应用程序开机启动

如果你不再想应用程序在登陆时启动:

  • 系统 > 首选项 > 会话
  • 选择“会话启动程序”标签
  • 选择你想移除的程序
  • 点击“移除”
  • 点击“关闭”

或者

  • 取消对话框程序名字旁边的复选框

会话选项

AddingProgramToSessionStartup?action=AttachFile&do=get&target=options.png

这个标签允许你告诉系统记得登出时正在运行的应用程序,且在下次登录开始时运行这些程序。这依靠勾选注销时自动记住正在运行的应用程序的复选框来完成。 相似地,点击软盘图标,告诉系统记住当前运行的应用程序(例如pidgin),且在下个会话开始时运行那些应用程序。

当前会话

这个标签显示当前运行的进程。

修改程序运行选项

现在你可能想修改程序开机时的运行方式。可以通过命令行的参数来达到,命令行分为几个部分:

evolution --component=mail

第一部分“evolution”是运行的命令。 第二部分呃“--component=mail”叫做参数。你可以修改这个参数来修改evolution的启动方式。真正的窍门是找出命令支持什么参数。你可以通过Google查找这些参数。你可以通过终端来测试这些参数:

  • 程序 > 附件 > 终端

找出变化。当你找到正确的参数就可以修改开机的参数。 祝你好运……

开机时把程序移到一个工作区和其它高级参数

在使用上面描述的方法后,所有的应用程序运行在同一个工作区,最大化等等。如果你希望在工作区2最小化运行一个程序,你可以手动达到目的——除非你安装了devilspie——详情可以在论坛的贴[1] 中找到。

建议

这是一种非常手动的方法去自动运行gdesklet,Firestarter(防火墙)或者其它程序。一些程序会在你第一次配置他们时把自己添加进“会话启动程序”标签。