Help:Autostart

From Openbox

(Difference between revisions)
Jump to: navigation, search
Line 12: Line 12:
 
* It runs <code>gnome-settings-daemon</code> if you have GNOME installed, so that your GTK applications will look and work the way they have been set up through the GNOME configuration tools.
 
* It runs <code>gnome-settings-daemon</code> if you have GNOME installed, so that your GTK applications will look and work the way they have been set up through the GNOME configuration tools.
 
* It runs <code>kdeinit</code> if you have KDE installed, so that your KDE applications will have the background processes running that they need.
 
* It runs <code>kdeinit</code> if you have KDE installed, so that your KDE applications will have the background processes running that they need.
* It runs <code>scim</code> if you have SCIM installed, and sets up a number of environment variables to enable SCIM for GTK and KDE applications. You may also need to set your language in the LC_CTYPE environment variable before running SCIM, with a line such as:
 
<code><pre>export LC_CTYPE=ja_JP.utf8</pre></code>
 
  
 
== Making your own autostart ==
 
== Making your own autostart ==
 
If you want to launch more programs at startup than those provided in the default autostart file, create the file <code>~/.config/openbox/autostart.sh</code>. You can run the system-wide autostart through this file by using the command "<code>. $GLOBALAUTOSTART</code>". Here's an example <code>~/.config/openbox/autostart.sh</code> file:
 
If you want to launch more programs at startup than those provided in the default autostart file, create the file <code>~/.config/openbox/autostart.sh</code>. You can run the system-wide autostart through this file by using the command "<code>. $GLOBALAUTOSTART</code>". Here's an example <code>~/.config/openbox/autostart.sh</code> file:
 
<code><pre>
 
<code><pre>
# Set my language up
 
export LC_CTYPE=ja_JP.utf8
 
 
 
# Run the system-wide support stuff
 
# Run the system-wide support stuff
 
. $GLOBALAUTOSTART
 
. $GLOBALAUTOSTART
 +
 +
# SCIM language support
 +
export LC_CTYPE=ja_JP.utf8
 +
export XMODIFIERS=@im=SCIM
 +
export GTK_IM_MODULE=scim
 +
export QT_IM_MODULE=scim
 +
scim -d &
  
 
# Programs to launch at startup
 
# Programs to launch at startup

Revision as of 00:17, 10 June 2007

(thumbnail)
Figure 1: The "Openbox" session type at log in

When you log in with the "Openbox" session type, or launch Openbox with the openbox-session command, the autostart script will be executed to set up your environment and launch any applications you want to run at startup.

When you run the openbox command on its own, the autostart scripts will not run. They are run by openbox-session or when you log in graphically with the "Openbox" session type.

You can use this script to launch a panel, to set your desktop wallpaper, or anything else.

The autostart script is located at ~/.config/openbox/autostart.sh. If that file does not exist, then the system-wide default script, located at /etc/xdg/openbox/autostart.sh, is run instead.

The default autostart file sets up a number of things for you:

  • It sets a plain color for the background so you don't have to see the ugly default X background
  • It runs gnome-settings-daemon if you have GNOME installed, so that your GTK applications will look and work the way they have been set up through the GNOME configuration tools.
  • It runs kdeinit if you have KDE installed, so that your KDE applications will have the background processes running that they need.

Making your own autostart

If you want to launch more programs at startup than those provided in the default autostart file, create the file ~/.config/openbox/autostart.sh. You can run the system-wide autostart through this file by using the command ". $GLOBALAUTOSTART". Here's an example ~/.config/openbox/autostart.sh file:

# Run the system-wide support stuff
. $GLOBALAUTOSTART

# SCIM language support
export LC_CTYPE=ja_JP.utf8
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE=scim
export QT_IM_MODULE=scim
scim -d &

# Programs to launch at startup
hsetroot ~/wallpaper.png &
xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &

# Programs that will run after Openbox has started
(sleep 2 && fbpanel) &

Make sure that you end any commands with "&" so that they are run in the background, or any programs after it (including Openbox!) will not run until it finishes.

If a program needs to be run after Openbox starts, then you can use a sleep to give Openbox time to run, as you can see for fbpanel in the above example.

You do not need to run Openbox at the end of this script. This script is run just before Openbox is launched by openbox-session.

Personal tools