autostart script

Please post all general support questions for LXDE here.
Locked
unclecameron
Posts: 2
Joined: Mon May 04, 2009 3:06 pm

autostart script

Post by unclecameron »

I'm trying to autostart a Python GUI script after LXDE launches (remaster Knoppix 6) I've tried creating a /home/knoppix/.config/somescript.desktop file which contains:

Code: Select all

[Desktop Entry]
Type=Application
Exec=/home/knoppix/somescript.py
and that didn't work, neither did creating ~./.config/openbox/autostart.sh containing:

Code: Select all

# 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've also tried creating /home/knoppix/.config/autostart folder and putting a symlink in there to the .py script I want to run (I can't just cp the file tree in there or it would try
to run all the support files) but that doesn't work either. I can't seem to find any other command line edit that will accomplish this, which is what I need. Thanks for the help.
paxman
Posts: 10
Joined: Sat May 02, 2009 6:00 pm

Re: autostart script

Post by paxman »

Try changing the Exec command to "python /home/knoppix/somescript.py" and copying the resulting *.desktop file to /home/knoppix/.config/autostart.
unclecameron
Posts: 2
Joined: Mon May 04, 2009 3:06 pm

Re: autostart script

Post by unclecameron »

none of them worked, here's what I did:

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

Code: Select all

[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

Code: Select all

[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

Code: Select all

#!/bin/bash
sudo /pathtorootscript/rootscript.sh
and that all worked. This took a ton of time to figure out, I hope it helps.
Locked