autostart under /etc/xdg/lxsession/Lubuntu/ does not works

Please post all general support questions for LXDE here.
Locked
martro
Posts: 4
Joined: Wed Dec 04, 2013 2:49 pm

autostart under /etc/xdg/lxsession/Lubuntu/ does not works

Post by martro »

Hi,
i don't know if is a bug on lubuntu 13.10
I'm trying to start a script after login.
My script is that:

Code: Select all

#!/bin/bash

echo "Hello World" > /tmp/hello.txt
if i running it from shell

Code: Select all

./hello.sh
user@localhost:~/Desktop$ ls -alh /tmp/hello.txt
-rw-rw-r-- 1 user user 12 dic  2 11:12 /tmp/hello.txt
Well. I'm changing /etc/xdg/lxsession/Lubuntu/autostart like this

Code: Select all

@/home/user/Desktop/hello.sh
but after login nothing happens

Code: Select all

ls -alh /tmp/hello.txt
ls: cannot access /tmp/hello.txt: No such file or directory
but if change local autostart

Code: Select all

cat /etc/xdg/lxsession/Lubuntu/autostart > /home/user/.config/lxsession/Lubuntu/autostart
after login it works

Code: Select all

ls -alh /tmp/hello.txt
-rw-r--r-- 1 user user 12 dic  2 11:44 /tmp/hello.txt
What's wrong? How can set my lubuntu in order to run the same script for all users?
Rex Bouwense
Posts: 1109
Joined: Sat Aug 27, 2011 5:44 pm
Location: Sierra Vista, Arizona USA
Contact:

Re: autostart under /etc/xdg/lxsession/Lubuntu/ does not wor

Post by Rex Bouwense »

Hi. Welcome to the lxde forum. Look at this site:
http://lxlinux.com/#4
Specifically, the last paragraph of #4.
There is also an old bug filed on SourceForge.
http://sourceforge.net/tracker/index.ph ... tid=894869
So, it appears that if you are using both locations to auto start only the home location will work. Is that what is happening in your case?
Rex
martro
Posts: 4
Joined: Wed Dec 04, 2013 2:49 pm

Re: autostart under /etc/xdg/lxsession/Lubuntu/ does not wor

Post by martro »

Rex Bouwense wrote:Hi. Welcome to the lxde forum.
Thank you ;)
Rex Bouwense wrote: Look at this site:
http://lxlinux.com/#4
Specifically, the last paragraph of #4.
There is also an old bug filed on SourceForge.
http://sourceforge.net/tracker/index.ph ... tid=894869
So, it appears that if you are using both locations to auto start only the home location will work. Is that what is happening in your case?
That's it.
Now i've modified /etc/xdg/lxsession/Lubuntu/autostart and deleted home autostart.
And everytime l'm logging in /etc/xdg/lxsession/Lubuntu/autostart will copied in home autostart
Rex Bouwense
Posts: 1109
Joined: Sat Aug 27, 2011 5:44 pm
Location: Sierra Vista, Arizona USA
Contact:

Re: autostart under /etc/xdg/lxsession/Lubuntu/ does not wor

Post by Rex Bouwense »

Great. Stick around if you can to provide help to others. We are a small forum and are constantly looking for more volunteers to help when they can (in any way.)
Rex
Locked