PDA

View Full Version : LXDE autostart scripts



unclecameron
05-02-2009, 01:30 AM
I'm trying to get Knoppix 6 to autostart 2 scripts, both after it launches LXDE:

1. a script to run as root that mounts filesystems a certain way

for this I started by putting a symlink to the real script in rc5.d, but that didn't work, so I cp'ed the script to /etc/init.d/myscript.sh after setting chmod 755 and ran

update-rc.d myscript.sh defaults
which looked successful but it doesn't work after the remaster. I suppose all the rest of the init scripts need to run first to populated fstab, how would I do this?

2. a GUI python script to run after the desktop comes up. I've tried creating a /home/knoppix/.config/somescript.desktop file which contains:


[Desktop Entry]
Type=Application
Exec=/home/knoppix/somescript.py

and that didn't work, neither did creating ~./.config/openbox/autostart.sh containing:


# Run the system-wide support stuff
. $GLOBALAUTOSTART
# Programs to launch at startup
hsetroot ~/wallpaper.png &
xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &
# Programs that will run after Openbox started
(sleep 2 && somescript.py) &


I can't seem to find any other command line edit that will accomplish this, which is what I need. Thanks for the help.

edit: I figured it out, do this:

create /etc/xdg/autostart/someentry.desktop containing:


[Desktop Entry]
Name=Somename
Comment=Scanner
Type=Application
Exec=/home/knoppix/somescript.py
Terminal=false
X-GNOME-Autostart-enabled=true

I also wanted to run a root mount script, which I did by creating another file in the same dir of somerootscript.desktop


[Desktop Entry]
Name=somerootscript
Comment=Somescript
Type=Application
Exec=/home/knoppix/rootscript.sh
Terminal=false
X-GNOME-Autostart-enabled=true

in /home/knoppix/rootscript.sh I put


#!/bin/bash
sudo /pathtorootscript/rootscript.sh

and that all worked. This took a ton of time to figure out, I hope it helps.