Help:Autostart

From Openbox

(Difference between revisions)
Jump to: navigation, search
(Making your own autostart)
Line 16: Line 16:
 
* 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>xdg-autostart</code>, if you have PyXDG installed, to run any programs that have requested to be started with the X session. (It does not run GNOME or KDE specific applications unless asked to, see <code>xdg-autostart --help</code>.)  <code>xdg-autostart</code> is installed to <code>/usr/lib/openbox/</code> because it will be distributed as part of the PyXDG package in the future.
 
* It runs <code>xdg-autostart</code>, if you have PyXDG installed, to run any programs that have requested to be started with the X session. (It does not run GNOME or KDE specific applications unless asked to, see <code>xdg-autostart --help</code>.)  <code>xdg-autostart</code> is installed to <code>/usr/lib/openbox/</code> because it will be distributed as part of the PyXDG package in the future.
 +
 +
== Setting up your environment ==
 +
If you would like to set environment variables that will affect openbox, you can place them in <code>~/.config/openbox/environment</code>.  This file is run before openbox and so will affect everything run in your current login session.  Here's an example <code>~/.config/openbox/environment</code> file:
 +
<code><pre>
 +
export PATH=$HOME/bin:$PATH
 +
export LC_CTYPE=ja_JP.utf8
 +
export XMODIFIERS=@im=SCIM
 +
export GTK_IM_MODULE=scim
 +
export QT_IM_MODULE=scim
 +
</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</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 different programs with Openbox than those provided in the default autostart file, create the file <code>~/.config/openbox/autostart</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</code> file:
 
<code><pre>
 
<code><pre>
 
# Run the system-wide support stuff
 
# Run the system-wide support stuff
 
. $GLOBALAUTOSTART
 
. $GLOBALAUTOSTART
  
# Programs to launch at startup
+
# Programs that will run after Openbox has started
 
hsetroot ~/wallpaper.png &
 
hsetroot ~/wallpaper.png &
 
xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &
 
xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &
  
 
# SCIM support (for typing non-english characters)
 
# SCIM support (for typing non-english characters)
export LC_CTYPE=ja_JP.utf8
 
export XMODIFIERS=@im=SCIM
 
export GTK_IM_MODULE=scim
 
export QT_IM_MODULE=scim
 
 
scim -d &
 
scim -d &
  
# Programs that will run after Openbox has started
+
# A panel for good times
(sleep 2 && fbpanel) &
+
fbpanel &
 
</pre></code>
 
</pre></code>
  

Revision as of 15:15, 3 August 2011

(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.

Note: Some distributions ship an "openbox" session type (for display managers) that simply calls the openbox binary. You want to select the entry that mentions "session."

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 xfce-mcs-manager otherwise so that GTK applications will inherit their settings from the XFCE configuration tools.
  • It runs kdeinit if you have KDE installed, so that your KDE applications will have the background processes running that they need.
  • It runs xdg-autostart, if you have PyXDG installed, to run any programs that have requested to be started with the X session. (It does not run GNOME or KDE specific applications unless asked to, see xdg-autostart --help.) xdg-autostart is installed to /usr/lib/openbox/ because it will be distributed as part of the PyXDG package in the future.

Setting up your environment

If you would like to set environment variables that will affect openbox, you can place them in ~/.config/openbox/environment. This file is run before openbox and so will affect everything run in your current login session. Here's an example ~/.config/openbox/environment file:

export PATH=$HOME/bin:$PATH
export LC_CTYPE=ja_JP.utf8
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE=scim
export QT_IM_MODULE=scim

Making your own autostart

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

# Run the system-wide support stuff
. $GLOBALAUTOSTART

# Programs that will run after Openbox has started
hsetroot ~/wallpaper.png &
xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &

# SCIM support (for typing non-english characters)
scim -d &

# A panel for good times
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.

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