Page 1 of 1

Run a file after login

Posted: Fri Aug 09, 2013 11:28 pm
by emptybee
Hi all,

Asked a similar question over in the gaming section but haven't had a response so thought I would post here.

I have set user "pi" to auto login on boot and now I would like USP to start automatically after this. How can I do this? Read something about /etc/profile but don't understand it enough to implement it.

At the moment I have to type: cd /usp [press enter] then ./unreal_speccy_portable [enter]

What is the easiest way to have this launch straight after boot up?

Thanks,

emptybee

Re: Run a file after login

Posted: Sat Aug 10, 2013 1:29 am
by JustThisGuy
I'm assuming you are using Raspbian.

When You log in you are given a bash shell. While bash is coming up (so you can type in it) it reads and executes commands in the file /home/pi/.bashrc. Since this file starts with a period (.) it is normally hidden. A directory listing with the -a (lowercase a) parameter (ls -a) will list all the hidden files.

You can add the command you want to execute at each login to the bottom of .bashrc with the editor of your choice. I use vi. ymmv.

My guess at the command you want to add to .bashrc is:

'/usp/unreal_speccy_portable'

without the single quotes. This assumes the usp directory is under the root of the file system (/) and not under the user pi's home directory.