PDA

View Full Version : Set startup program



RedWagon
11-28-2007, 12:39 AM
Is there any way to set a program to start as soon as the computer boots up?
This is a PC gutted and slashed to the bone that will sit in an attic and serve as a cheap network projector. It's actually starting to look quite implressiveI want TightReciever (a wine program) to start as soon as the computer turns on so we will only need a mouse and keyboard in emergencies.

This thing is actually starting to look quite impressive... I'll post some pics as soon as it's done.

cantab
11-28-2007, 10:21 AM
If you put it in ~/.kde/Autostart and have KDE starting on boot that will work. Create a one-line script

#!/bin/bash
wine /path/to/tightreciever # you can use the Unix or windows path I think


If you're using a different desktop environment, it may have something corresponding. I presume you are using _a_ desktop environment, based on what TightReciever/TightProjector do.

RedWagon
11-28-2007, 03:48 PM
I don't know much about writing scrips but it looks like # is for comments. What does #!/bin/bash mean?

maxIT
11-28-2007, 05:03 PM
I don't know much about writing scrips but it looks like # is for comments. What does #!/bin/bash mean?
# is a comment
#! also known as the 'sha-bang', at the head of a script tells your system that this file is a set of commands to be fed to the command interpreter indicated (http://tldp.org/LDP/abs/html/sha-bang.html), being in this case 'bash' but could even be perl (#!/usr/bin/perl) ,tcl (#!/usr/bin/tcl) or something else.

cantab
11-28-2007, 05:49 PM
I don't know much about writing scrips but it looks like # is for comments. What does #!/bin/bash mean?
# is a comment
#! also known as the 'sha-bang', at the head of a script tells your system that this file is a set of commands to be fed to the command interpreter indicated (http://tldp.org/LDP/abs/html/sha-bang.html), being in this case 'bash' but could even be perl (#!/usr/bin/perl) ,tcl (#!/usr/bin/tcl) or something else.

Yes, # is for comments, EXCEPT in the case of the #!, which is as described.

Also, I forgot to mention

You need to do

$ chmod ugo+rx your_script.sh

to make it executable. (Note the .sh file extension is entirely optional, but useful)