Showing posts with label openbox. Show all posts
Showing posts with label openbox. Show all posts

Monday, 3 August 2009

Delay applications running with sleep from autostart

This is how to cause some programs to wait until they run from the autostart, I will cover both Gnome and Openbox.

First, how to do this in Gnome. Fire up the Session manager either from preferences or via:

gnome-session-properties

Now when you either edit an existing entry, or add a new one the command should be in the following format:

bash -c "sleep 30; gnome-do"

This will make Gnome Do wait 30 seconds before running, obviously you can adjust the 30 and the command to run as your needs dictate. Any changes will be affected when you next login of course.

For Openbox we need to edit ~/.config/openbox/autostart.sh (where ~/ relates to your own home folder, the system will translate it). The file is a simple text format with one command per line, almost all applications in here will want a & (ampersand) after them. The ampersand tells the system to run the command and not wait for it to finish before going to the next, without it Openbox would likely run the first command then stall loading, waiting for it to end before it would even finish loading the desktop.

Ok, the magic to cause the delay....

(sleep 30s && ubuntuone-client-applet) &

Please note the parenthesis, its apparently very important to ensure the command is bracketed like this. Again you may adjust the delay time, and the command (in this case ubuntuone-client-applet)



How to create Debian menu for Openbox

This may also work for other WM like Fluxbox and TWM.

The Debian menu builds a menu from all the installed applications on your system and nicely organises them. I believe it also keeps it updated when you install new software so you do not have to manually add items to your Openbox menu.

To install it use:

sudo aptitude install menu

After it is installed run:

sudo update-menus

To enable the menu in Gnome go to the desktop panel menu:

System / Preferences / Main Menu and enable the Debian menu under Applications.