[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to run script after login



Hmm,

The only way I seem to be able to make lxde to do something when logging in is to put an application starter in /etc/xdg/autostart

I tried to put a script call zz-my-computer in /etc/X11/Xsession.d

containing just one line;
/bin/mkdir $HOME/Desktop/test

I tried without $HOME also, giving a specific path the user has write access to, just to see if that was the issue. I also tried adding #!/bin/bash on top of the script, but to me it looks like Xsession is running the scripts in Xsession.d as though they are parts of one script. then that should not be necessary.

I also tried chmoding the script +x, but that should not be necessary either, if Xsession is doing the actual "run".

then I tried to add;
sh /usr/local/bin/my-desktop.sh

That script works if executed by the user after logged in, but does run by the entry in /etc/X11/Xsession.d

Have you tried this on lxde? I dont know why it doesnt work.

Greetings  /George


--- Den mån 2012-05-28 skrev Petter Reinholdtsen <pere@hungry.com>:

> Från: Petter Reinholdtsen <pere@hungry.com>
> Ämne: Re: How to run script after login
> Till: debian-edu@lists.debian.org
> Datum: måndag 28 maj 2012 11:17
> [George]
> > Hi,
> > 
> > Where do I preferably put a script that is supposed to
> run *after* login?
> > Im running Squeeze with lxde
> > I don't want to put it in user homedirs (.bashrc), its
> systemwide scripts.
> > 
> > I tried /etc/rc.local and /etc/profile.d but it does
> not seem to do anything..
> 
> For X logins, put it in /etc/X11/Xsession.d/.  It will
> run as the user, the
> same way /etc/profile.d is used when shells start.
> 
> If you need to run it as root, a PAM hook is probably the
> right way.  See
> for example how libpam-mklocaluser uses libpam-python.
> 
> > The thing is, the script has to be run after login
> (when variables like
> > $HOME is set). I tried to put the script in both chroot
> and in tjener.
> > For thin clients its supposed to be in /etc/, not in
> chroot, right?
> 
> Yes.
> -- 
> Happy hacking
> Petter Reinholdtsen
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-edu-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: 20120528091726.GN8172@ulrik.uio.no">http://lists.debian.org/20120528091726.GN8172@ulrik.uio.no
> 
>


Reply to: