5

I'm running a script that changes files and installs things and what not on a SUSE computer. One of the scripts that gets run with my script, reboots the computer and when the computer loads back up again I want my script to continue where it left off.

What I can't figure out is where to launch my script so that it will start AFTER the desktop has loaded back up (the SUSE computer is set to automatically log in as a specific user who isn't root).

I want my script to run in this fashion because I want the user to be able to see an output log as to what is happening before another script later on reboots the computer again.

Edit: Following the link given below: https://bbs.archlinux.org/viewtopic.php?id=130344 I found out that the directory that is supposed to be where you put scripts specifically for my question is /home/user/.kde4/Autostart.

In my attempt to follow this I found that I do not have a .kde4 directory, but I do have a .kde directory. I decided this was probably the same thing and investigated finding that .kde does have Autostart. So I placed my script in there.

This resulted in my script being opened by KWrite (just the basic text editor) when my desktop loads. But the script itself doesn't get run.

I created a new directory, .kde4 with Autostart in it to place my script hoping that this would solve the problem. No luck, though, as my script doesn't even get opened in KWrite in this situation.

Edit2: I changed the permission on my script chmod 777 script and now it starts up. It's in my home/user/.kde/Autostart directory.

  • KDE or GNOME desktop? – slm May 14 '14 at 19:54
  • How do I check that? I'm pretty sure it's KDE, but I want to be certain. – James May 14 '14 at 19:56
  • Does this return any results? ps -eaf|grep gnome-session – slm May 14 '14 at 20:07
  • It only returns one line. [user] 3576 3442 0 19:27 pts/1 00:00:00 grep gnome-session – James May 14 '14 at 20:09
  • So you're using KDE then. I'd start with this: bbs.archlinux.org/viewtopic.php?id=130344 – slm May 14 '14 at 20:15
3

If using KDE you should go to System Settings -> Startup and Shutdown -> Autostart, click Add Script button, add you script there and set it to run at Startup.

From command line you could create a symlink in the following folder /home/username/.kde4/Autostart like this:

sudo ln -s /path/to/your/script /home/username/.kde4/Autostart/script
  • I don't want to add the script with System Settings (which I can't find anyway) because it defeats the purpose of just clicking the script and having it do everything for me. I tried using the command line option you gave, but I still get the same result that the script just gets opened in KWrite. I don't have a .kde4 directory, just a .kde folder. I tried creating a .kde4 directory with Autostart in it and placed the script in there just like your example, but then nothing happened, not even the script being loaded in KWrite. – James May 15 '14 at 13:04
  • If you have only .kde directory then put the script there in /home/username/.kde/Autostart and make sure the script is executable by running chmod +x /path/to/script – cioby23 May 15 '14 at 13:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.