how to autorun a script after login

I have a simple little script that I’m using to build a digital picture frame:

#!/bin/sh

Script to run Digital Picture Frame using Feh

hide the cursor after 15 seconds

unclutter -idle 5 &

Start slide show

feh -q -Z -z -r -D 5 -F /home/dpf/photos &

exit 0

it runs great if I launch it manually from a terminal window, but how can I get it to launch automatically once the user dpf logs in?

I have the YaST user settings such that dpf is the default user and logs in without a password.

If you use kde, i suggest you copy your script in /home/dpf/.kde/Autostart (/home/dpf/.kde/Autostart if you use kde4) and make sure your script file is executable .

the script file is named “start_frame.sh”

by executable, do you mean setting the permissions using chmod?

The name does not matter and yes, you make something executeable by setting the appropriate x-bits with chmod.

which in your case would mean:
su -c ‘chmod +x start_frame.sh’

Why the su? I do not see any mention of the fact that this script is owned by and/or should be run as root.

It is his login as normal user and this user wants to run it and, as I read the OP, it is his script. No root involved IMHO.

Yes, or simply right click the file in file manager (konqueror, dolphin, …) and look for something like ‘properties’ and find a check box to tick the executable if needed.

I can run the script manually without su, but if I need to make any modifications, then su is req’d

thanks to all for the suggestions

BTW: placing the script in the home/dpf/.kde4/Autostart directory worked!

I do not understand this. It is the script that dpff wants to be run. It is in dpfs’ home directory. dpf is the one who made it (I hope). Is not dpf the owner of home/dpf/.kde4/Autostart/<thescript> ? That should be the case. And then no *su *(to root) is needed anywhere! And when root is not needed, it is a major sinn to run as root.