分类: LINUX
2012-01-09 13:36:19
Contents
This HOWTO explains how to get programs to launch when you login into your WM (Window Manager) and/or DE (Desktop Environment). 这个 HOWTO 介绍了怎样在你登录进你的Window Manager(窗口管理器)或DE(桌面环境)时如何自动启动程序。 NOTE: New users should note that ~ equals user's home directory. Also note that these instructions should work on these Window Managers on most Distributions in addition to Gentoo. 注意:新手要注意~表示用户的home目录,且以下的介绍应该能在大多数窗口管理器还有Gentoo号上有效。 Programs that you wish to autostart on GNOME startup can be selected by using the Control Center. To do this, open the Control Center and then navigate to Sessions followed by Startup Programs. Click Add and either type the path, or use Browse to select your desired program[s]. If multiple programs are selected, they can be launched in a desired order. 你想自启动的程序可以通过在控制面板上选择。打开 控制面板 的 Startup Programs 里的Sessions 项,单击 Add 并敲入路径或浏览选择你要自启动的程序。如果选择了多个程序,它们可以按顺序启动。 If the GUI is not available or desireable, then one can instead modify ~/.gnome2/session-manual. Syntax is as follows: 如果没在 GUI 下或者不是在GNOME的GUI下,那么可以编辑 ~/.gnome2/session-manual。语法如下:
Programs that you wish to autostart on KDE startup need to be placed into ~/.kde/Autostart. KDE的自启动的程序需要放在 ~/.kde/Autostart 目录下。 Below is an example of autostarting GAIM written in bash. 下面是一个用bash脚本写的自动启动GAIM的例子。 nano -w gaim (example script below)
Below is an alternative for the same example, this time using a soft link. 下面是同样例子的另一种实现方法。这次用一个软链接。 ln -s /usr/bin/gaim gaim You can also put files here. For example, you can drag a shortcut from the K Menu. 你也可以把.desktop文件放在这目录下。譬如,你可以从 K Menu 中拖一个快捷方式到目录下。
To Autostart a program in KDE you simply need to put a symbolic link to the executable file in the Autostart directory. In most cases this is located at: 要在KDE里自动启动程序你只要简单地把一个指向可执行文件的符号链接放到 Autostart 目录。多数情况下这个目录在 If wanted to have xbindkeys start automatically when KDE started then I would locate the the executable file for xbindkeys. In my installization it is located at: 譬如想在 KDE 启动时自动启动 xbindkeys,此应用程序可执行文件在我的系统中在 All you have to do is place a symbolic link in the Autostart directory: 你只要在 Autostart 目录种放一个符号链接: This command creates a link named "xbindlink" in the Autostart directory that links to the executable located in the /usr/bin/ directory. 这个命令在 Autostart 目录中创建一个叫"xbindlink"的链接,链接到 /usr/bin 目录中的可执行文件。 Restart KDE and you should be in business. 重启KDE即可达到目的。 I hope this helps. 希望有帮助。 Programs that you wish to autostart on Xfce4 startup can be selected by using the xfce4-autostart-editor tool available in Xfce4 menu > Settings > Xfce 4 Autostarted Applications. If the GUI is not desirable, you can put .desktop files in the ~/.config/autostart/ directory. If this directory does not exist, simply create it. Note: In the Xfce versions prior to 4.4 the programs had to be located in ~/Desktop/Autostart.
Below is an example of autostarting GAIM written in bash. cd ~/Desktop/Autostart #since version 4.4 ~/.config/autostartnano -w gaim (example script below)
For a simpler approach, a link will work as well: cd ~/Desktop/Autostart #since version 4.4 ~/.config/autostartln -s `which gaim` Fluxbox Programs that you wish to autostart on Fluxbox startup need to be placed into ~/.fluxbox/startup and fluxbox needs to be started with startfluxbox To start Fluxbox locally or globally with startx, ensure that your ~/.xinitrc (for local) or /etc/X11/xinit/xinitrc (for global) file contains the line:
Below is an example of line you need to add to autostart GAIM. cd ~/.fluxboxnano -w startup
IceWM is very similar to Fluxbox in that you have a script that is executed when IceWM starts up, simply add all the commands you'd like executed to ~/.icewm/startup. Note that since this is executed as a script all programs should either detach themselves or be backgrounded. Unlike Fluxbox however this script does not need to start up IceWM itself. The file should be a well-formed script, eg:
And of course, it should be marked as executable: $ chmod a+x ~/.icewm/startupFVWM Programs that you wish to autostart on startup need to be placed into ~/.fvwm/.fvwm2rc Below is an example of line you need to add to autostart GAIM. cd ~/.fvwmnano -w .fvwm2rc After the line, if non-existing, add it.
Since e16.8 you can use/create ~/.e16/{Start Stop Init} folders. All you need to do is:
thats it Enlightenment DR17Note: Recent versions of e17 don't use eap files anymore but ordinary .desktop-files. Just substitute .eap with .desktop and forget the part about creating eap-files.
Programs that you wish to autostart on startup should have their corresponding .eap file listed in ~/.e/e/applications/startup/.order Below is an example of making GAIM autostart:
This, obviously, relies on the application you wish to autostart having a .eap file to begin with! (There's a full list at ~/.e/e/applications/all) If that isn't the case, you can create one (here we're going to execute a simple script to start the daemon):
This will launch a dialog: we need to set the App Name to 'beagled' and the Executable should point to our script (in my case its ~/bin/beagled.sh: obviously you should set appropriately). Finally, we need to add out new .eap to the startup list:
|