个人工具

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

来自Ubuntu中文

跳转至: 导航, 搜索
第2行: 第2行:
 
{{Languages|UbuntuHelp:AddingProgramToSessionStartup}}
 
{{Languages|UbuntuHelp:AddingProgramToSessionStartup}}
 
There are two ways to get Ubuntu to load applications automatically each time you start up:
 
There are two ways to get Ubuntu to load applications automatically each time you start up:
# Save your session when you log off, and the applications will be restarted when you sign back on.
+
<ol><li>Save your session when you log off, and the applications will be restarted when you sign back on.
# Configure Ubuntu to run an application every time you sign on.
+
</li><li>Configure Ubuntu to run an application every time you sign on.</li></ol>
 
=== Session Preferences Dialogue ===
 
=== Session Preferences Dialogue ===
 
{|border="1" cellspacing="0"
 
{|border="1" cellspacing="0"
第9行: 第9行:
 
|}
 
|}
 
Each time you logon to Ubuntu you are creating a "session."  To customize your session, you have to modify the session settings. To do this go to:
 
Each time you logon to Ubuntu you are creating a "session."  To customize your session, you have to modify the session settings. To do this go to:
* '''System > Preferences > Sessions'''
+
<ul><li>'''System > Preferences > Sessions'''
 
Ubuntu opens a dialog box that allows you to configure your session settings.  In Ubuntu 5.10 (Breezy Badger) there are three tabs:  "Session Options", "Current Sessions" and "Startup Programs".
 
Ubuntu opens a dialog box that allows you to configure your session settings.  In Ubuntu 5.10 (Breezy Badger) there are three tabs:  "Session Options", "Current Sessions" and "Startup Programs".
 
=== Session Options ===
 
=== Session Options ===
 
This tab allows you to create mutliple custom sessions, each with its own settings. If you only need one setup, you can use the session named "Default"
 
This tab allows you to create mutliple custom sessions, each with its own settings. If you only need one setup, you can use the session named "Default"
* "Show splash screen on login"
+
<ul><li>"Show splash screen on login"
* "Ask on logout" -- if checked, you will be asked each time you log out whether you want to save the current configuration.
+
</li><li>"Ask on logout" -- if checked, you will be asked each time you log out whether you want to save the current configuration.
* "Automatically save changes to session" -- If checked, Ubuntu will save your session at each logout and restore the same configuration when you login again. This can have unwanted side effects like restarting the program that you cannot get out of, so consider carefully what you want to achieve.
+
</li><li>"Automatically save changes to session" -- If checked, Ubuntu will save your session at each logout and restore the same configuration when you login again. This can have unwanted side effects like restarting the program that you cannot get out of, so consider carefully what you want to achieve.</li></ul>
 
=== Current Session ===
 
=== Current Session ===
 
This tab shows the processes that are currently running.
 
This tab shows the processes that are currently running.
第30行: 第30行:
 
Select the text in the Command field and copy it using control-c.
 
Select the text in the Command field and copy it using control-c.
 
Now we want to add this to our startup applications.
 
Now we want to add this to our startup applications.
* Go to System > Preferences > Sessions
+
<ul><li>Go to System > Preferences > Sessions
* Select the "Startup Programs" tab
+
</li><li>Select the "Startup Programs" tab
* Click add
+
</li><li>Click add
* In the "Startup command" box, paste the command you copied with control-v (see above)
+
</li><li>In the "Startup command" box, paste the command you copied with control-v (see above)
* Click OK (You should see your new command)
+
</li><li>Click OK (You should see your new command)
* Click Close
+
</li><li>Click Close</li></ul>
 
Test by logging on and off.
 
Test by logging on and off.
 
=== If the application you want to add doesn't have an icon in the menu bar ===
 
=== If the application you want to add doesn't have an icon in the menu bar ===
第43行: 第43行:
 
=== To stop an application from running at startup ===
 
=== To stop an application from running at startup ===
 
If you no longer want the application to start up when you logon:
 
If you no longer want the application to start up when you logon:
* Go to System > Preferences > Sessions
+
<ul><li>Go to System > Preferences > Sessions
* Select the "Startup Programs" tab
+
</li><li>Select the "Startup Programs" tab
* Select the application you want to remove
+
</li><li>Select the application you want to remove
* Click Delete
+
</li><li>Click Delete
* Click Close
+
</li><li>Click Close</li></ul>
 
=== Modifying program run options ===
 
=== 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:
 
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:
第55行: 第55行:
 
The first part "evolution" is the command that is running.
 
The first part "evolution" is the command that is running.
 
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 findout 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:
 
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 findout 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:
* '''Applications > Accessories > Terminal'''
+
<ul><li>'''Applications > Accessories > Terminal'''
 
And try out variations first. Once you have it right then you can change the settings in startup.
 
And try out variations first. Once you have it right then you can change the settings in startup.
 
Good luck...
 
Good luck...

2007年12月6日 (四) 14:38的版本


There are two ways to get Ubuntu to load applications automatically each time you start up:

  1. Save your session when you log off, and the applications will be restarted when you sign back on.
  2. Configure Ubuntu to run an application every time you sign on.

Session Preferences Dialogue

AddingProgramToSessionStartup?action=AttachFile&do=get&target=Screenshot-Sessions.png

Each time you logon to Ubuntu you are creating a "session." To customize your session, you have to modify the session settings. To do this go to:

  • System > Preferences > Sessions Ubuntu opens a dialog box that allows you to configure your session settings. In Ubuntu 5.10 (Breezy Badger) there are three tabs: "Session Options", "Current Sessions" and "Startup Programs".

    Session Options

    This tab allows you to create mutliple custom sessions, each with its own settings. If you only need one setup, you can use the session named "Default"

    • "Show splash screen on login"
    • "Ask on logout" -- if checked, you will be asked each time you log out whether you want to save the current configuration.
    • "Automatically save changes to session" -- If checked, Ubuntu will save your session at each logout and restore the same configuration when you login again. This can have unwanted side effects like restarting the program that you cannot get out of, so consider carefully what you want to achieve.

    Current Session

    This tab shows the processes that are currently running.

    Startup Applications

    This tab allows you to specify any applications that you want to run each time you begin a session, as well as the priority or ordering of these startup applications. An example of such an application would be the network-manager applet (nm-applet), which allows easier access to wireless networks. To add an applications click the "Add" button and type in the command you would use on the command line to run the application (see below). Then set the priority by adjusting the 'Order' field. Lower numbers load first, higher numbers later.

    How to find the appropriate startup command

    To determine the text for the startup command, you can check the 'Basic' tab of the properties for the application's icon. 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 title bar each time you start up, you can add the appropriate command to the Startup Sessions tab. Find the icon for Evolution in the title bar at the top of the screen. Right click on it, and select 'Properties'. This will bring up the 'Launcher Properties' dialog box. The 'Basic' tab lists the appropriate command under the 'Command' field; in this case the appropriate text is:

    evolution --component=mail
    

    Select the text in the Command field and copy it using control-c. Now we want to add this to our startup applications.

    • Go to System > Preferences > Sessions
    • Select the "Startup Programs" tab
    • Click add
    • In the "Startup command" box, paste the command you copied with control-v (see above)
    • Click OK (You should see your new command)
    • Click Close

    Test by logging on and off.

    If the application you want to add doesn't 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 you 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 Delete
    • Click Close

    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:

    evolution --component=mail
    

    The first part "evolution" is the command that is running. 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 findout what the command line supports. You might try Google to search for these options. You can test these out on a command line:

    • 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: [1]

      Comments

      This is a very handy way to start 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.